asp.net.ph

DataColumnMappingCollection.Item Property ( Int32 )

System.Data.Common Namespace   DataColumnMappingCollection Class


Sets or retrieves the DataColumnMapping from the collection at the specified index.

Syntax


DataColumnMapping variable = DataColumnMappingCollection.Item [ index ];
... or ...
DataColumnMapping variable = DataColumnMappingCollection [ index ];
  C# VB JScript

Parameters

index
The index of the DataColumnMapping to return.

Property Value

The DataColumnMapping at the specified index.

Exceptions


Exception Type Condition
IndexOutOfRangeException Occurs when the index value is greater than the number of items in the collection.

Remarks

Use the Contains method to test for the existence of a specific DataColumnMapping.

Example

The following example demonstrates using the Item property to print the values of each DataColumnMapping object in the collection.

void getColumnMappings ( DataTableMapping myTableMap ) {
   // get column mappings
   DataColumnMappingCollection myFieldMaps = myTableMap.ColumnMappings;
   string myMessage = "Column Mappings:\n";

   for ( int i=0; i < myFieldMaps.Count; i++ ) {
      myMessage += i.ToString ( ) + " " + myFieldMaps [ ].ToString ( ) + "\n";
   }
   Response.Write ( myMessage );
}
  C# VB

See Also

DataColumnMappingCollection Members   DataColumnMappingCollection.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