datatable doesn't see modified rows

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi,

I'm binding a DataTable to several controls and everything
seems to be reflected okay. When comes to updating the
database, I'm calling DataTable's Select(string.Empty,
string.Empty, DataViewRowState.ModifiedCurrent) and
passing this DataRow[] into SqlDataAdapter's Update()
method.

Unfortunately, Select() doesn't seem to see modified
values as modified values because it's returning a DataRow
[] with zero elements.

This leads me to believe that when a control updates the
DataTable, it calls the DataTable's AcceptChanges()
method. How do I prevent this from happening?

Thanks,
Paul
 
Ah, I figured it out. In order for a modification to be
recognized, you need to move off the current position and
move back.
 
Back
Top