Verifies if a given table can be removed from the collection.
[Visual Basic] Public Function CanRemove( _ ByVal table As DataTable _ ) As Boolean [C#] public bool CanRemove( DataTable table ); [C++] public: bool CanRemove( DataTable* table ); [JScript] public function CanRemove( table : DataTable ) : Boolean;
true if the table can be removed; otherwise, false.
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.
[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 If
TablesCollection Class | TablesCollection Members | System.Data Namespace | Item | IndexOf | Remove