Tuesday, June 28, 2011

VB.NET: "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records" Error

Today as i was working on 1 of my projects i came across an error saying "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records". After a few minutes of troubleshooting, it turned out that the dataadapter does not allow updating tables without primarykeys as well as those tables that use Autonumbers or AutoIncrement values for their primary key, so i went back and changed the auto-generated code for my dataAdapters update command and all went pretty smoothly after...

I hope this post helps beginners like me resolve similar error that they may encounter in the future when creating VB.NET + OLEDB based systems...