System.Data Namespace DataTable Class
Commits all the changes made to this table since the last time AcceptChanges was called.
[ VB ]
Public Sub AcceptChanges ( )
[ C# ]
public void AcceptChanges ( );
[ C++ ]
public: void AcceptChanges ( );
[ JScript ]
public function AcceptChanges ( );
When AcceptChanges is called, any DataRow object still in edit mode successfully ends its edits. The DataRowState also changes: all Added and Modified rows become Unchanged; Deleted rows are removed.
CAUTION: The AcceptChanges method should never be called on a DataTable until after you attempt to update the DataSet using the DbDataAdapter.Update method.
When you invoke AcceptChanges, all rows marked as Added, Modified, or Deleted will then become marked Original. In that case, the DataSet has no way of knowing which rows must be propagated to the database management system.
The following example shows using the AcceptChanges method on a DataTable.
DataTable Members AcceptChanges BeginEdit DataRowState EndEdit RejectChanges