c# - DisconectedContext was detected -


i need getting rid of error:

"transition com context 0x465608 runtimecallablewrapper failed following error: system call failed. (exception hresult: 0x80010100 (rpc_e_sys_call_failed)). typically because com context 0x465608 runtimecallablewrapper created has been disconnected or busy doing else. releasing interfaces current com context (com context 0x465498). may cause corruption or data loss. avoid problem, please ensure com contexts/apartments/threads stay alive , available context transition, until application done runtimecallablewrappers represents com components live inside them."

which occurs during execution of code:

int = 2;  while(i <= lastrowpopt) {      refdocno = poptsheet.cells[i, 1].text;      refitem = poptsheet.cells[i, 2].text;      plnt = poptsheet.cells[i, 3].text;      concat = refdocno + refitem + plnt;      poptsheet.cells[i, 8] = concat;      poptsheet.range["e" + i, "g" + i].copy(type.missing);      poptsheet.range["i" + i, "k" + i].pastespecial(microsoft.office.interop.excel.xlpastetype.xlpasteall);       i++; } 

there around 4700 rows , it's job on 1000 , something, throws that. execution lasts 4 mins, think stalls of time.

since didn't find resolution that, used oledbconnection , dataset instead of interop services works fine that.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -