asp.net.ph

DataColumnMappingCollection.Count Property

System.Data.Common Namespace   DataColumnMappingCollection Class


Returns the number of DataColumnMapping objects in the collection.

Syntax


Script [ integer variable = ] DataColumnMappingCollection.Count

Property Value


variable Integer specifying the total number of DataColumnMapping objects in the collection.

The property is read only with no default value.

Implements

ICollection.Count

Remarks

Use the Count property to determine the number of DataColumnMapping objects contained in the DataColumnMappingCollection of a specified DataTableMapping object. Count is commonly used when iterating through the collection to determine the upper bound of a loop.

Example

The following example demonstrates using the Count property to determine the upper bound of a DataColumnMappingCollection. This value is then used to iterate though the collection.

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

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

See Also

DataColumnMappingCollection 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