Mono Class Library: System.Data.DataSet Overview | Members

System.Data.DataSet.AcceptChanges Method

Commits all the changes made to this DataSet since it was loaded or since the last time AcceptChanges was called.

public void AcceptChanges ()

Remarks

AcceptChanges is a way to accept data changes within a DataSet in a hierarchical manner. The method is also present in the System.Data.DataTable and System.Data.DataRow classes which allows the data acceptance process to descend in the hierarchy. If AcceptChanges is called on the DataSet, the implementation will in turn call the AcceptChanges method on all the DataTable instances in the table collection and the tables will invoke the method on the DataRow objects they own. That allows you to selectively accept changes in a flexible way.

Calling AcceptChanges on the DataSet affects the DataRow objects in the way dependant on the state the rows are in at the point of the method call. And so, if a DataRow is in the edit mode, the mode will be successfully ended. If a row is in the Added or Modified state, as indicated by the DataRow.RowState property, it will become Unchanged and the rows found in the Deleted state are removed from the DataSet.

A System.Data.ForeignKeyConstraint found attached to the DataSet causes the ForeignKeyConstraint.AcceptRejectRule to be enforced.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0