System.Data.DataRow.Delete Method

Deletes the System.Data.DataRow.

Syntax

public void Delete ()

Remarks

If the DataRow.RowState of the row is Added, the DataRow.RowState becomes Detached and the row is removed from the table when you call DataRow.AcceptChanges.

The DataRow.RowState becomes Deleted after you use the DataRow.Delete method on an existing System.Data.DataRow. It remains Deleted until you call DataRow.AcceptChanges. At this time, the System.Data.DataRow is removed from the table.

DataRow.Delete should not be called in a foreach loop while iterating through a System.Data.DataRowCollection object. DataRow.Delete modifies the state of the collection.

A deleted row can be undeleted by invoking DataRow.RejectChanges.

Note:

The DataRow.BeginEdit method temporarily suspends DataTable.RowChanging events, but the delete operation does not.

Requirements

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