asp.net.ph

DataColumnMappingCollection IndexOfDataSetColumn Method

System.Data.Common Namespace   DataColumnMappingCollection Class


Returns the index of a DataColumnMapping with the specified DataSetColumn name.

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

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

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

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

Parameters

dataSetColumn
The case-insensitive name of a DataSetColumn.

Return Value

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

Example

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

public void FindDataColumnMapping ( DataTableMapping myTable ) {
   // get column mappings
   DataColumnMappingCollection myColumns = myTable.ColumnMappings;
   DataColumnMapping mycolumn;
   if ( myColumns.IndexOfDataSetColumn ( "acct_ID" ) != -1 ) {
      mycolumn = myColumns.GetByDataSetColumn ( "acct_ID" );
   }
}
  C# VB

See Also

DataColumnMappingCollection 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