asp.net.ph

DataRow.AcceptChanges Method

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 ( );

Remarks

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.

Example

The following example shows using the AcceptChanges method on a DataTable, which cascades to all DataRow objects it contains.

DataList Editing Command Events Example
Run Sample | View Source
See Also

DataRow Members   AcceptChanges   BeginEdit   CancelEdit   DataViewRowState   DataTable   EndEdit   HasVersion   Item   RowState Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph