DataSet.AcceptChanges?

  • Thread starter Thread starter Christopher Weaver
  • Start date Start date
C

Christopher Weaver

I can't get this method to work as I expect it to. If I edit a row within a
DataSet, then invoke the DA's Update, the changes to the current row are
lost. If I move off the modified row then invoke Update the changes are
written to the back end. I assumed that AcceptChanges would cause any
changes in the current row to be included in the Update process, but those
changes are still being lost.

How do I ensure that the current rows changes will be included in the DA's
Update call?
 
Christopher Weaver said:
I can't get this method to work as I expect it to. If I edit a row within a
DataSet, then invoke the DA's Update, the changes to the current row are
lost. If I move off the modified row then invoke Update the changes are
written to the back end. I assumed that AcceptChanges would cause any
changes in the current row to be included in the Update process, but those
changes are still being lost.

No, quite the opposite. AcceptChanges is used to tell the DataSet that
all the modifications have been successfully accepted. Don't call
AcceptChanges manually and everything should be okay.
 
So how do I tell the DataSet to include the current row's changes in the
Update process? Unless I move off the row they are lost.
 
Christopher Weaver said:
So how do I tell the DataSet to include the current row's changes in the
Update process? Unless I move off the row they are lost.

IIRC, you call EndEdit on the row. You should probably ask on the
adonet newsgroup though - it's a while since I've done data binding.
 
I'll look into it. Thanks.


Jon Skeet said:
IIRC, you call EndEdit on the row. You should probably ask on the
adonet newsgroup though - it's a while since I've done data binding.
 
Back
Top