System.Data Namespace DataRowCollection Class
Clears the collection of all rows.
[ VB ]
Public Sub Clear ( )
[ C# ]
void Clear ( );
[ C++ ]
public: void Clear ( );
[ JScript ]
public function Clear ( );
Use this method to remove all DataRow objects from the Rows collection of a specified table.
This method resets the Rows.Count property to 0.
The following example clears a DataRowCollection of all items.
private void ClearTable ( DataTable myTable ) {
DataRowCollection myRows = myTable.Rows;
' clear all rows.
myRows.Clear ( );
}
Private Sub ClearTable ( ByVal myTable As DataTable )
Dim myRows As DataRowCollection = myTable.Rows
' clear all rows.
myRows.Clear
End Sub |
|
C# |
VB |
DataRowCollection Members Add Remove