Verifies whether a table, specified by index, exists in the collection.
[Visual Basic] Overloads Public Function Contains( _ ByVal index As Integer _ ) As Boolean [C#] public bool Contains( int index ); [C++] public: bool Contains( int index ); [JScript] public function Contains( index : int ) : Boolean;
true if the specified table exists; otherwise, false.
The following example tests whether a table with the index 10 exists in the TablesCollection.
[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 | TablesCollection.Contains Overload List | Item | IndexOf | Remove | CanRemove