Removes a table from the collection.
Removes the table at the given index from the collection
[Visual Basic] Overloads Public Sub Remove(Integer)
[C#] public void Remove(int);
[C++] public: void Remove(int);
[JScript] public function Remove(int);
Removes the table with a specified name from the collection.
[Visual Basic] Overloads Public Sub Remove(String)
[C#] public void Remove(String);
[C++] public: void Remove(String*);
[JScript] public function Remove(String);
Removes the specified table from the collection.
[Visual Basic] Overloads Public Sub Remove(DataTable)
[C#] public void Remove(DataTable);
[C++] public: void Remove(DataTable*);
[JScript] public function Remove(DataTable);
The following example uses the CanRemove to test whether each table can be removed from a DataSet. If so, the Remove method is called to remove the table.
Note This example shows how to use one of the overloaded versions of Remove. For other examples that may be available, see the individual overload topics.
[Visual Basic]
Private Sub RemoveTables() Dim t As DataTable Dim dSet As DataSet ' Presuming a DataGrid is displaying more than one table, get its DataSet. Set dSet = DataGrid1.DataGridTable.DataTable.DataSet For each t in dSet.Tables If dSet.CanRemove t Then dSet.Remove t Next End Sub
TablesCollection Class | TablesCollection Members | System.Data Namespace