Concurrency violation on Row Delete in Data Grid

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
 
K

Ken Tucker [MVP]

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top