| re: DataTable AcceptChanges set RowState to Modified
Well tried looking into that Plater but didn't have any luck.
I did find a less elegant work-around. If I find the modified, added and deleted rows via DataTable.Select then I can AcceptChanges at the row level and this seems to work. e.g.:
DataRow[] deletedRows = DataSet.Tables[1].Select(null, null, DataViewRowState.Deleted);
foreach (DataRow _ddr in deletedRows)
{
_ddr.AcceptChanges();
}
DataRow[] addedRows = DataSet.Tables[1].Select(null, null, DataViewRowState.Added);
foreach (DataRow _ddr in addedRows)
{
_ddr.AcceptChanges();
}
DataRow[] updatedRows = DataSet.Tables[1].Select(null, null, DataViewRowState.ModifiedCurrent);
foreach (DataRow _ddr in updatedRows)
{
_ddr.AcceptChanges();
}
I'm sure there will be a little more overhead with this but shouldn't have any effect for what I'm doing with it. I won't have more than 2 or 3 modifications to AcceptChanges on at a time.
~Thanks
|