asp.net.ph

DataTableCollection.Item Property ( String )

System.Data Namespace   DataTableCollection Class


Returns the DataTable with the specified name.

Syntax


DataTable variable = DataTableCollection.Item [ name ];
... or ...
DataTable variable = DataTableCollection [ name ];
  C# VB JScript

Parameters

name
The name of the DataTable to find.

Property Value

A DataTable with the specified name; otherwise a null value if the DataTable does not exist.

Remarks

Use the Contains method to determine if a table with a specific name exists. If you have the name of a table, but not its index, use the IndexOf method to return the index.

Example

The following example retrieves a single table by name from a DataTableCollection.

private void GetTableByName ( DataSet ds ) {
   // get a specific table by name.
   DataTable tbl = ds.Tables [ "Suppliers" ];
   Response.Write ( tbl.TableName );
}
  C# VB

See Also

DataTableCollection Members   DataTableCollection.Item Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph