Concurrency violation on Row Delete in Data Grid

  • Thread starter Thread starter BobAchgill
  • Start date Start date
B

BobAchgill

Do you know why this error might be happening? Maybe it
is because I have two data adapters open on the same MDB
file?? If this is the problem... how can I keep them
from disturbing each other?

An unhandled exception of
type 'System.Data.DBConcurrencyException' occurred in
system.data.dll

Additional information: Concurrency violation: the
DeleteCommand affected 0 records.

Thanks!

Bob
 
Hi,

I doubt the error is because you have more than one dataadapter to
the same db. I would guess that the error is because deleting a row that is
related to others. Try enclosing the dataadapters update command in a try
catch block. The exception will contain a more detailed error message.

Ken
---------------------
Do you know why this error might be happening? Maybe it
is because I have two data adapters open on the same MDB
file?? If this is the problem... how can I keep them
from disturbing each other?

An unhandled exception of
type 'System.Data.DBConcurrencyException' occurred in
system.data.dll

Additional information: Concurrency violation: the
DeleteCommand affected 0 records.

Thanks!

Bob
 
Bob,

I had a very similar problem. It turned out to be a crazy thing. It had
nothing to do with concurrency at all; it was that I changed the size of a
field after I had created my dataadapter. All I needed to do was change the
size in the dataadapter's commands and no longer got the concurrency error.
Check to see that the data definition is the same as when you originally
created the dataadapter. Good Luck.

Cheryl
 
Back
Top