|
-
Jul 14th, 2009, 05:37 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] DBConcurrencyException - Access

(Using C# Professional 2008 and an Access 2003 *.mdb database)
I'm getting a fairly standard concurrency violation...
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.
... when I attempt to update my table adapter (built in the designer). I've researched the subject, so I know what a concurrency error means (database is different to what the application expects it to be) but I can thus far find no reason it to occur. It is not connected to a network, so it cannot be a valid concurrency violation. 
The function is quite complex: After performing a custom Fill on the data (I generate an OleDbDataAdapter, feed it with an SQL string and run it on the Table), it trawls the DataGridView, makes changes to a single column (removes some values, modifies some, and leaves the rest alone) using a "row[x].cell[y].Value = newValue" mechanic.
Once this is done, I call BindingSource.EndEdit(), and TableAdapter.Update(Table). I then get the aforementioned error, every time this is run on this set of data. Interestingly, I have had no problems running this on different sets of data in the past.
The row returned by the error appears to be the top-most one, where cell[y].Value has been removed (replaced with an empty string).
I'm hoping someone can give me some information on this: thus far, I can find nothing that can help. Any help or information is sincerely appreciated.
Thanks,
Qu.
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
| Pong| |
Sorry for not posting more often.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|