c# - Microsoft Access OledbDataReader read values error -
i connecting ms access file jet engine x64,but worked x86 platform. getting error while trying read data
long sizecounter = 0, rowindex = 0; var secondvalues = new object[batchsize][]; (var secondindex = 0; secondindex < secondvalues.length; secondindex++) secondvalues[secondindex] = new object[reader.fieldcount]; while (reader.read()) { //todo:error here... reader.getvalues(secondvalues[sizecounter]); sizecounter++; if (notifyafter > 0 && (rowindex % notifyafter == 0 && rowindex > 0 && rowscopied != null)) { rowscopied(this, new rowscopiedeventargs(rowindex)); } if (sizecounter == batchsize) { runbulkcopy(secondvalues); sizecounter = 0; } rowindex++; } var lastvalues = new object[sizecounter][]; (var lastindex = 0; lastindex < sizecounter; lastindex++) lastvalues[lastindex] = secondvalues[lastindex]; runbulkcopy(lastvalues); if (rowscopied != null) rowscopied(this, new rowscopiedeventargs(rowindex)); } catch (exception) { if (rowscopied != null) rowscopied(this, new rowscopiedeventargs { abort = true }); }
unable cast com object of type 'system.__comobject' interface type 'irowset'. operation failed because queryinterface call on com component interface iid '{0c733a7c-2a1c-11ce-ade5-00aa0044773d}' failed due following error: no such interface supported (exception hresult: 0x80004002 (e_nointerface)).
thanks!
oledb data connector has bug when used in multi-threaded projects.the exception throws when create oledb object in sta apartment , call mta.
Comments
Post a Comment