System.Data Namespace DataTableCollection Class
Clears the collection of all tables.
[ VB ]
Public Sub Clear ( )
[ C# ]
void Clear ( );
[ C++ ]
public: void Clear ( );
[ JScript ]
public function Clear ( );
Use this method to remove all DataTable objects from a given DataSet.Tables collection. To remove a particular DataTable from the collection, use the Remove method.
This method resets the Tables.Count property to 0.
The following example gets the DataTableCollection of a given DataSet, then clears the collection.
private void ClearTable ( DataSet ds ) {
DataTableCollection myTables = ds.Tables;
myTables.Clear ( );
}
Private Sub ClearTable ( ByVal ds As DataSet )
Dim myTables As DataTableCollection = ds.Tables
myTables.Clear ( )
End Sub |
|
C# |
VB |
DataTableCollection Members Add Remove