asp.net.ph

DataTableCollection.IndexOf Method

System.Data Namespace   DataTableCollection Class


Returns the index of the specified DataTable.

Overload List

Returns the index of a specified DataTable object.

Returns the index of a DataTable with the specified name.


Example

The following example returns the index of a named table in a DataTableCollection.

NOTE: This example uses one of the overloaded versions of IndexOf. For other examples that may be available, see the individual overload topics.

private void GetIndexes ( DataSet ds ) {
   DataTableCollection myTables = ds.Tables;
   // get the index of the table named "Authors", if it exists.
   if ( myTables.Contains ( "Authors" ) ) {
      Response.Write ( myTables.IndexOf ( "Authors" ) );
   }
}
  C# VB

See Also

DataTableCollection Members 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