asp.net.ph

DataTable.AcceptChanges Method

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

Remarks

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.

Example

The following example shows using the AcceptChanges method on a DataTable.

Run Sample | View Source
See Also

DataTable Members   AcceptChanges   BeginEdit   DataRowState   EndEdit   RejectChanges 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