DataAdapter concurrency error

bluep651

Member
Joined
Feb 16, 2009
Messages
7
Programming Experience
Beginner
Hi,
I have a datagridview bound in code to a dataset and a dataadapter. Sometimes when adding a record I get a concurrency error - the DeleteCommand affected 0 of the expected 1 records - even though no other users use the database. Any ideas anyone ?

TIA
 
After further investigation I think this is because I have an identity field as the primary key. Changing the primary key seems to have solved it thanks
 
Hi,
I have a datagridview bound in code to a dataset and a dataadapter. Sometimes when adding a record I get a concurrency error - the DeleteCommand affected 0 of the expected 1 records - even though no other users use the database. Any ideas anyone ?

TIA



It simply means that at the time the adapter wanted to update a row you had marked as deleted, the database returned that it had deleted 0 rows. Either the key you are using locally to identify the row is faulty, or some of the data in the database has changed relative to what the datatable last had it recorded as (if your query is optimistically concurrent)
 

Latest posts

Back
Top