DataTableMappingCollection.Count Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the number of DataTableMapping objects in the collection.

Namespace:   System.Data.Common
Assembly:  System.Data (in System.Data.dll)

[BrowsableAttribute(false)]
public int Count { get; }

Property Value

Type: System.Int32

The number of DataTableMapping objects in the collection.

The following example creates a DataTableMappingCollection, adds DataTableMapping objects to the collection, and displays a list of the mapped source tables.

public void CreateTableMappings() 
{
    DataTableMappingCollection mappings = 
        new DataTableMappingCollection();
    mappings.Add("Categories","DataCategories");
    mappings.Add("Orders","DataOrders");
    mappings.Add("Products","DataProducts");
    string message = "TableMappings:\n";
    for(int i=0;i < mappings.Count;i++)
    {
        message += i.ToString() + " " 
            + mappings[i].ToString() + "\n";
    }
    Console.WriteLine(message);
}

.NET Framework
Available since 1.1
Return to top
Show: