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.Item

[To be supplied.]

[C#] In C#, this member is the indexer for the TablesCollection class.

Overload List

Gets the table specified by its index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As DataTable
[C#] public DataTable this[int] {get;}
[C++] public: __property DataTable* get_Item(int);
[JScript] TablesCollection.Item (int)

Gets the table in the collection with the given name (not case-sensitive).

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As DataTable
[C#] public DataTable this[String] {get;}
[C++] public: __property DataTable* get_Item(String*);
[JScript] TablesCollection.Item (String)

Example [Visual Basic]

The following example retrieves a single table by name from the TablesCollection.

Note   This example shows how to use one of the overloaded versions of the Item property (TablesCollection indexer). For other examples that may be available, see the individual overload topics.

[Visual Basic]

Private Sub GetTableByName()
   Dim tablesCol As TablesCollection
   Dim dSet As DataSet
   Dim t As DataTable
   ' Presuming a DataGrid is displaying more than one table, get its DataSet.
   Set dSet = DataGrid1.DataGridTable.DataTable.DataSet
   ' Get the TablesCollection.
   Set tablesCol = dSet.Tables
   ' Get a specific table by name.
   Set t = tablesCol("Suppliers")
   Console.WriteLine(t.TableName)
End Sub

See Also

TablesCollection Class | TablesCollection Members | System.Data Namespace