System.Data Namespace DataRow Class
Commits all the changes made to this row since the last time AcceptChanges was called.
[ VB ]
Public Sub AcceptChanges ( )
[ C# ]
void AcceptChanges ( );
[ C++ ]
public: void AcceptChanges ( );
[ JScript ]
public function AcceptChanges ( );
When invoking AcceptChanges, any DataRow object still in edit-mode successfully ends its edit. The RowState property of each DataRow also changes; Added and Modified rows become Unchanged, and Deleted rows are removed.
Both the DataTable and DataSet classes also have AcceptChanges methods. In this manner, you have multiple levels at which the method can be invoked.
Calling AcceptChanges on a DataTable causes each DataRow object's AcceptChanges method to be called. Calling the AcceptChanges of the DataSet allows you to invoke the method on all subordinate objects ( all tables and rows ) with one call.
If the DataSet contains ForeignKeyConstraint objects, invoking the AcceptChanges method also causes the AcceptRejectRule to be enforced.
The following example shows using the AcceptChanges method on a DataTable, which cascades to all DataRow objects it contains.
DataRow Members AcceptChanges BeginEdit CancelEdit DataViewRowState DataTable EndEdit HasVersion Item RowState