System.Data.DataRowCollection.Remove Method

Removes the specified System.Data.DataRow from the collection.

Syntax

public void Remove (DataRow row)

Parameters

row
The System.Data.DataRow to remove.

Remarks

When a row is removed, all data in that row is lost. You can also call the DataRow.Delete method of the System.Data.DataRow class to just mark a row for removal. Calling Remove is the same as calling DataRow.Delete and then calling DataRow.AcceptChanges.

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

You can also use the DataRowCollection.Clear method to remove all members of the collection at one time.

Requirements

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