DataAdapter Update method throws DBConcurrencyException

A

Ahmed

I am having this problem with an application which seems to call
DBConcurrencyException when calling the Update Method to my DataAdapter.
It seems to happen only when I add a new record to my DataTable and this is
the first row, if I have 2 rows the exception is not thrown. I really do not
know how to fix this problem, here is the flow to my application.
App Start -> Fill DataTable (Lets say it fill 0 records for the example) ->
Add new DataRow to Datatable -> Call DataAdapter Update Method (checked DB
after Update and it is there) -> Delete method called on DataRow from
DataTable -> Update method called on DataAdapter -> Exception thrown.
If the application fills 1 or more records initially the exception is not
thrown but why??
I do not know if I have been clear enough but I hope someone can help me
out!

TIA,
Ahmed
 
J

Jon Skeet [C# MVP]

Ahmed said:
I am having this problem with an application which seems to call
DBConcurrencyException when calling the Update Method to my DataAdapter.
It seems to happen only when I add a new record to my DataTable and this is
the first row, if I have 2 rows the exception is not thrown. I really do not
know how to fix this problem, here is the flow to my application.
App Start -> Fill DataTable (Lets say it fill 0 records for the example) ->
Add new DataRow to Datatable -> Call DataAdapter Update Method (checked DB
after Update and it is there) -> Delete method called on DataRow from
DataTable -> Update method called on DataAdapter -> Exception thrown.
If the application fills 1 or more records initially the exception is not
thrown but why??
I do not know if I have been clear enough but I hope someone can help me
out!

What exactly is the exception? What's the message in it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top