NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TablesCollection.Contains (Int32)

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;

Parameters

index
The 0-based index to check for.

Return Value

true if the specified table exists; otherwise, false.

Example [Visual Basic]

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

See Also

TablesCollection Class | TablesCollection Members | System.Data Namespace | TablesCollection.Contains Overload List | Item | IndexOf | Remove | CanRemove