DataRow.RejectChanges Method ()

 

Rejects all changes made to the row since AcceptChanges was last called.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

member RejectChanges : unit -> unit

Exception Condition
RowNotInTableException

The row does not belong to the table.

When you call the RejectChanges method, the CancelEdit method is implicitly called to cancel any edits. If RowState is deleted or modified, the row reverts to its previous values, and RowState becomes unchanged. If the RowState is added, the row is removed.

The following example creates a simple DataTable with 2 columns and 10 rows. After several DataRow items are deleted with the Delete method, one of the rows is undeleted by invoking RejectChanges.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: