CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Posts
    3

    Error in TableAdapter.Update

    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

  2. #2
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Re: Error in TableAdapter.Update

    Some of us we only Understand English, Try to Show us the Exception in English

  3. #3
    Join Date
    Aug 2008
    Posts
    3

    Smile Re: Error in TableAdapter.Update

    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

  4. #4
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Re: Error in TableAdapter.Update

    Please try to Post your while code in DAL that does this Operation. Something is not initialized.

  5. #5
    Join Date
    Aug 2008
    Posts
    3

    Red face Re: Error in TableAdapter.Update

    Thanks.

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

  6. #6
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Re: Error in TableAdapter.Update

    lol hahahahaha
    Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured