NEWBIE: Concurrency violation after switching databases?
Posted on 2006-06-05
I'm a total newbie at VS2005 and C#. I'm writing a quickie app which will allow an in-house user to switch between working with the "same" table in a test and a production database. (The table has the same definition, with different data.)
When I open the app, I set the Database to "test". Then, I let the user change it to "production". So far, that works. I see the "production" table come up. However, when I try to Update the "production" table, I get this error:
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.
There are definitely no other users of either table. The Update on the original "test" table works fine.
This is the code I use to perform the Update:
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
This is the code I use to switch databases:
private void databasesToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
String curDb = e.ClickedItem.Text;
I should emphasize that I am a complete idiot at this point, and I'm probably missing something obvious!