asp.net.ph

DataTableMappingCollection.Item Property ( Int32 )

System.Data.Common Namespace   DataTableMappingCollection Class


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

Syntax


DataTableMapping variable = DataTableMappingCollection.Item [ index ];
... or ...
DataTableMapping variable = DataTableMappingCollection [ index ];
  C# VB JScript

Parameters

index
The index of the DataTableMapping to return.

Property Value

The DataTableMapping 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 DataTableMapping.

Example

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

void getTableMappings ( DataAdapter myAdapter ) {
   // get table mappings
   DataTableMappingCollection myTables = myAdapter.TableMappings;
   string myMessage = "Table Mappings:\n";

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

See Also

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