Update record - what is wrong?

Dont call .AcceptChanges until after you have done the .Update().

AcceptChanges resets the RowState of all rows in the DataSet / DataTable, so when the .Update is called it doesnt see any rows has having changes.
 
PlausiblyDamp said:
Dont call .AcceptChanges until after you have done the .Update().

AcceptChanges resets the RowState of all rows in the DataSet / DataTable, so when the .Update is called it doesnt see any rows has having changes.


I get this message when I dont have acceptchanges:

Update requires a valid UpdateCommand when passed DataRow collection with modified rows.

??

Kid Icarus.
 
Have you assigned a valid command to the DataAdapters .UpdateCommand property? If not then the Adapter has no way of knowing how to send the updates back to the data source.

Either write a valid update command (prefered way) or try to see if the CommandBuilder class can do it for you.
 
Back
Top