System.Data Namespace DataTableCollection Class
Returns a specified table from the collection.
1. Returns the DataTable with the specified name.
2. Returns the DataTable at the specified index.
The following example retrieves a single table by name from a DataTableCollection.
NOTE: This example uses one of the overloaded versions of Item. For other examples that may be available, see the individual overload topics.
private void GetTableByName ( DataSet ds ) {
// get a specific table by name.
DataTable tbl = ds.Tables [ "Suppliers" ];
Response.Write ( tbl.TableName );
}
Private Sub GetTableByName ( ByVal ds As DataSet )
' get a specific table by name.
Dim tbl As DataTable = ds.Tables ( "Suppliers" )
Response.Write ( tbl.TableName )
End Sub |
|
C# |
VB |
DataTableCollection Members