asp.net.ph

DataRowCollection.Remove Method

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

Parameters

row
The DataRow to remove.

Remarks

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.

Example

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 );
  C# VB

DataList DeleteCommand Event Example
Run Sample | View Source
Enabling Multiple Item Deletions in DataGrid
Run Sample | View Source

See Also

DataRowCollection Members   Add   Clear   Contains   Find 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