Click to See Complete Forum and Search --> : ERROR: Concurrency violation!


laxatcg1
February 11th, 2007, 09:47 PM
Am working in VS2005/SQL/VB/Windowsapp.

I first developed a windowsapp with SQL with DB in Net Server but now am coverting the same windowsapp with the local database with MS-Access. I have changed all the connection string and all SQL related statements to OleDB wherever necessary. Now the application is working fine and I could able to submit the forms and store it in local DB but the PROBLEM is when I try to edit/update I get this error:

"DBConcurrencyException was unhandled -
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records."

And the breakpoint error line is: adapter.Update(dt)

Where could be the problem? PLease guide/help me. Thank you.

jmcilhinney
February 12th, 2007, 02:36 AM
A concurrency violation occurs when the original version of the data stored in your app doesn't match the data in the database when you try to save your changes. Anything that could cause that situation to arise could be the problem. Either changes are being made to the database from another source between when you get the data and when you save it, or else you're messing up your data in your app.