locked
dertemine the index of the row in the datatable that caused dbconcurrency exception RRS feed

  • Question

  • Using Vs05 pro vb/sql express...

     

    Say you are updating a table with 10 rows, of which only 1 has been modified and thus will be truly update.  Then lets say that one modified row throws a concurrency exception.

     

    How do I get the Index of the row in the table that threw the exception?  In other words, lets say it is row 8.  How can I dertemine the index of the row in the datatable that caused the dbconcurrency exception?

     

    Thanks!

    Bob

    Thursday, May 24, 2007 4:07 PM

Answers

  • Hi,

    This exception generally occurs if the DataRow are out of synch with the contents of the corresponding row in the database. Are you generating any data while inserting it into your database - auto-increment values,defaults, etc.? If so, you'll need to re-fetch the contents of the row
    after performing the insert by handling the DataAdapter's RowUpdated event as described in Chapter 11.

    I hope this information proves helpful.

     

    With Regards

     

    Monday, May 28, 2007 5:42 AM

All replies

  • Hi,

    This exception generally occurs if the DataRow are out of synch with the contents of the corresponding row in the database. Are you generating any data while inserting it into your database - auto-increment values,defaults, etc.? If so, you'll need to re-fetch the contents of the row
    after performing the insert by handling the DataAdapter's RowUpdated event as described in Chapter 11.

    I hope this information proves helpful.

     

    With Regards

     

    Monday, May 28, 2007 5:42 AM
  • Thansk for you input, but that is not my question.  I fully understand what causes DBConcurrency Exceptions, my question is to identify the index of the row that caused it. 

     

    Any ideas?

    Bob

    Tuesday, May 29, 2007 4:37 PM