Verifies whether the collection contains a specific table.
Checks if a table, specified by name, exists in the collection.
[Visual Basic] Overloads Public Function Contains(String) As Boolean
[C#] public bool Contains(String);
[C++] public: bool Contains(String*);
[JScript] public function Contains(String) : Boolean;
Verifies whether a table, specified by index, exists in the collection.
[Visual Basic] Overloads Public Function Contains(Integer) As Boolean
[C#] public bool Contains(int);
[C++] public: bool Contains(int);
[JScript] public function Contains(int) : Boolean;
The following example tests whether a table with the index 10 exists in the TablesCollection.
Note This example shows how to use one of the overloaded versions of Contains. For other examples that may be available, see the individual overload topics.
[Visual Basic]
Private Sub TestForTableByIndex() Dim dSet As DataSet ' Get the DataSet of a DataGrid. Set dSet = DataGrid1.DataGridTable.DataTable.DataSet ' Get the TablesCollection through the Tables property. Dim tablesCol As TablesCollection Set tablesCol = dSet.Tables ' Check if a table with the index 10 exists. If tablesCol.Contains(10) Then MessageBox "Table with index 10 exists" Ene If End Sub
TablesCollection Class | TablesCollection Members | System.Data Namespace