ChoKamir
Member
Hey Guys,
Im having a weird problem. I wrote some simple application in c# which shows the data of a acces database in a datagridview. On the RowChanged and RowDeleted events of the dataset i do a dataAdapter.update(dataset). It works all fine, i can add new rows, change and delete excisting rows. All no problem.
The problem starts when i add a new row and then try to delete that newly added row. I know that it executes the insert statement and finishes it succesfully, so the row excists in the database aswell as in the datagridview. But when i then try to delete i get the DBConcurrencyException telling me: Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.
The weird thing is that when i first select another row and then return to the new row and delete it no problem. So my feeling is that it somehow didnt completly wrote the new row to the database but only to the memory or something like that. Is that possible? how can i check that? and how can i prevent it? This problem happens about 90% of the time.
I hope somebody can help out.
Greetings
ChoKamir
Im having a weird problem. I wrote some simple application in c# which shows the data of a acces database in a datagridview. On the RowChanged and RowDeleted events of the dataset i do a dataAdapter.update(dataset). It works all fine, i can add new rows, change and delete excisting rows. All no problem.
The problem starts when i add a new row and then try to delete that newly added row. I know that it executes the insert statement and finishes it succesfully, so the row excists in the database aswell as in the datagridview. But when i then try to delete i get the DBConcurrencyException telling me: Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.
The weird thing is that when i first select another row and then return to the new row and delete it no problem. So my feeling is that it somehow didnt completly wrote the new row to the database but only to the memory or something like that. Is that possible? how can i check that? and how can i prevent it? This problem happens about 90% of the time.
I hope somebody can help out.
Greetings
ChoKamir