System.Data Namespace DataRowCollection Class
Removes the specified DataRow from the collection.
[ VB ]
Public Sub Remove ( _
ByVal row As DataRow _
)
[ C# ]
public void Remove (
DataRow row
);
[ C++ ]
public: void Remove (
DataRow* row
);
[ JScript ]
public function Remove (
row : DataRow
);
- row
- The DataRow to remove.
When a row is removed, data in that row is lost. You can also call the DataRow class's Delete method to simply mark a row for removal. The row is not actually removed until the AcceptChanges method is invoked.
You can also use the Clear method to remove all members of the collection at once.
The following examples dmonstrate how to use the Remove method to delete a found row in a DataRowCollection object. In both examples, the Find method is first used to locate the specific row, then the Remove method is used to remove the row.
DataRow thisRow = myRows.Find ( cbItem.Text );
if ( thisRow != null ) myRows.Remove ( thisRow );
dim thisRow as DataRow = myRows.Find ( cbItem.Text )
if thisRow <> Nothing then myRows.Remove ( thisRow ) |
|
C# |
VB |
DataRowCollection Members Add Clear Contains Find