DisconnectedContext was detected
Message: Transition into COM context 0x676010 for this RuntimeCallableWrapper failed with the following error: System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)). This is typically because the COM context 0x676010 where this RuntimeCallableWrapper was created has been disconnected or it is busy doing something else. Releasing the interfaces from the current COM context (COM context 0x675ea0). This may cause corruption or data loss. To avoid this problem, please ensure that all COM contexts/apartments/thread
s stay alive and are available for context transition, until the application is completely done with the RuntimeCallableWrappers that represents COM components that live inside them.
sql2 = "select sum(InvoiceLineQuantity) as QSold from InvoiceLine where txnDate <= #" & newStart & "# and txnDate >= #" & newEnd & "# and InvoiceLineItemRefFullName = '" & ds.Tables(0).Rows(x).Item("FullName") & "'" da2 = New OleDbDataAdapter(sql2, cn) ds2 = New DataSet() da2.Fill(ds2, "table1") If ds2.Tables(0).Rows(0).Item("QSold").Equals(System.DBNull.Value) Then iis = 0 Else iis = ds2.Tables(0).Rows(0).Item("QSold").ToString() End If 'Credit memo section (added to subtract item returns for accurate total sales) sql2 = "select sum(CreditmemoLineQuantity) as CMSold from CreditmemoLine where txnDate <= #" & newStart & "# and txnDate >= #" & newEnd & "# and CreditMemoLineItemRefFullName = '" & ds.Tables(0).Rows(x).Item("FullName") & "'" da3 = New OleDbDataAdapter(sql2, cn) ds3 = New DataSet() da3.Fill(ds3, "table1") If ds3.Tables(0).Rows(0).Item("CMSold").Equals(System.DBNull.Value) Then cms = 0 Else cms = ds3.Tables(0).Rows(0).Item("CMSold") End If
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
13 Experts available now in Live!