Changed data in a dataset

  • Thread starter Thread starter Mark Goldin
  • Start date Start date
M

Mark Goldin

How can I select modified only data from a dataset and then turn it into an
xml?
Is it even possible?

Thanks
 
You can access a DataRow's RowState to see if the row has been changed:

foreach (DataRow row in dt.Rows) {
if (row.RowState == DataRowState.Modified){
//do something
}
}

You can also catch added or deleted rows....Make sure that AcceptChange()
isn't call before this, else all the RowState's will go back to UnChanged.

Karl
 
Back
Top