DataTableCollection.Item Property (String)
Gets the DataTable object with the specified name.
Assembly: System.Data (in System.Data.dll)
If a DataTable name exists that matches the case of the search string, it is returned. Otherwise a case-insensitive search is performed, and if a DataTable name is found that matches this search, it is returned.
Use the Contains method to determine whether a table with a specific name or index exists.
The following example retrieves a single table by name from the DataTableCollection.
Private Sub GetTableByName() ' Presuming a DataGrid is displaying more than one table, ' get its DataSet. Dim thisDataSet As DataSet = CType(DataGrid1.DataSource, DataSet) ' Get the DataTableCollection. Dim tablesCollection As DataTableCollection = thisDataSet.Tables ' Get a specific table by name. Dim table As DataTable = tablesCollection("Suppliers") Console.WriteLine(table.TableName) End Sub
Available since 1.1