Click to See Complete Forum and Search --> : Error in TableAdapter.Update


GordonSoda
August 20th, 2008, 03:24 AM
Hi gurus,

I'm using VS2005/ADO.NET 2.0 with SQLSERVER 2005.

I'm building a multithreaded application creating a high volume of rows (log&trace data).

Each thread adding row calls :

GoStatDataSet.TraceMessagesRow row = table.NewTraceMessagesRow();
...
lock (changelock)
{
table.AddTraceMessagesRow(row);
}


Then at regular interval thread calls to update database :

lock (changelock)
{
GoStatDataSet dsChanges = (GoStatDataSet)ds.GetChanges();
if (dsChanges != null)
{
adapter.Update(dsChanges);

ds.Merge(dsChanges);

ds.AcceptChanges();
}
}


But the adapter.Update() raise sometimes an exception :

L'exception System.InvalidOperationException n'a pas été gérée
Message="Le handle n'a pas été initialisé."
Source="System.Data"
StackTrace:
à System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
...


Any clue ?

Thanks
Gordon Soda

vuyiswam
October 3rd, 2008, 02:23 AM
Some of us we only Understand English, Try to Show us the Exception in English

GordonSoda
October 3rd, 2008, 02:35 AM
System.InvalidOperationException was unhandled
Message="Handle is not initialized."
Source="System.Data"
StackTrace:
à System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)

please :-)
Gordon Soda

vuyiswam
October 18th, 2008, 03:44 AM
Please try to Post your while code in DAL that does this Operation. Something is not initialized.

GordonSoda
October 21st, 2008, 03:03 AM
Thanks.

I have changed my mind, and no longer use this code.

vuyiswam
November 11th, 2008, 05:44 AM
lol hahahahaha :)