asp.net.ph

DataTableMappingCollection.Count Property

System.Data.Common Namespace   DataTableMappingCollection Class


Returns the number of DataTableMapping objects in the collection.

Syntax


Script [ integer variable = ] DataTableMappingCollection.Count

Property Value


variable Integer specifying the total number of DataTableMapping 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 DataTableMapping objects contained in the DataTableMappingCollection of a specified DataAdapter 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 DataTableMappingCollection. This value is then used to iterate though 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 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