Problem updating a dataset table row

K

Karl

Hi,

I am working with a dataset and want to update a row and
then call the appropriate adapter.update method to update
the source table.

This is how I am updating the row:
row = dataSet.Tables["tablename"].Rows.Find(rowId);
row["col1"] = newValue1;
row["col2"] = newValue2;

This changes the row's values and updates all child
records ok BUT when I come to apply the changes to the
source I get an error:
"Concurrency violation: the UpdateCommand affected 0
records."

Please help
 
M

Miha Markic

Hi Karl,

That's probably because you are modifying your primary key (col1?).
The adapter checks if the row exists in database before updating - see
"where" part of "update" sql statament.
 

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