asp.net.ph

DataTableMappingCollection IndexOfDataSetTable Method

System.Data.Common Namespace   DataTableMappingCollection Class


Returns the index of a DataTableMapping with the specified DataSetTable name.

[ VB ]
NotOverridable Overloads Public Function IndexOf ( _
   ByVal dataSetTable As String _
) As Integer

[ C# ]
public int IndexOf (
   String dataSetTable
);

[ C++ ]
public: __sealed int IndexOf (
   String* dataSetTable
);

[ JScript ]
public function IndexOf (
   dataSetTable : String
) : int

Parameters

dataSetTable
The case-insensitive name of a DataSetTable.

Return Value

The index of the DataTableMapping if it is in the collection; otherwise, -1.

Example

The following example searches for a DataTableMapping object with the given DataSetTable name. If the DataTableMapping exists, it is returned.

public void FindDataTableMapping ( DataAdapter myAdapter ) {
   // get table mappings
   DataTableMappingCollection myTables = myAdapter.TableMappings;
   DataTableMapping mytable;
   if ( myTables.IndexOfDataSetTable ( "tblEmployees" ) != -1 ) {
      mytable = myTables.GetByDataSetTable ( "tblEmployees" );
   }
}
  C# VB

See Also

DataTableMappingCollection Members   IndexOf   Contains 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