471,118 Members | 1,133 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,118 software developers and data experts.

Concurrency violation from IDbDataAdapter

Hidey ho,

This question relates to IDbDataAdapter, DataSets, XML, and DiffGrams.

I have a data adapter of type IDbDataAdapter and a dataset with one
table in it, which has one row in it, which has a RowState of Modified.

My dataadapter has been constructed properly in that it has all 4
Command objects required. The data connection object that the adapter
uses is of type IDbConnection (you guessed it!).

The problem is on the call to the Update method of the data adapter,
resulting in the ever detailed exception: "Concurrency violation: the
UpdateCommand affected 0 records".

Now here's the cool stuff. It only does this on the second (and
subsequent) times it hits this code. The first Update call (whether the
row is 'Added', 'Modified' or 'Deleted' works fine. The second one

Here's some more information possibly of use.

The dataset has actually been loaded from XML. In fact, its been loaded
from 2 sets of XML. The first XML was a Schema and data
After this I have loaded a second XML file to the same dataset, which
This allows for the ROWSTATE changes to be passed from the original
location (another PC in another part of cyberspace).
After this, I manually remove all rows that have a ROWSTATE of
UNCHANGED, simply because I want to and also because sometimes the data
adapter UPDATE method was adding those rows to the database anyway,
despite not having 'ADDED' rowstate.
So I am left with (USUALLY ONLY ONE) rows that have been edited,
deleted or created, in the dataset. Then the UPDATE call, and the

Hmm, can't think of anything else relevant right now.

I appreciate any help or debugging suggestions.

Steven Nagy

Dec 8 '05 #1
0 1056

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Billy Jacobs | last post: by
2 posts views Thread by Vladimir Oľura | last post: by
2 posts views Thread by Agnes | last post: by
5 posts views Thread by Vayse | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.