DataTableMappingCollection.Count DataTableMappingCollection.Count DataTableMappingCollection.Count DataTableMappingCollection.Count Property

定義

コレクション内の DataTableMapping オブジェクト数を取得します。Gets the number of DataTableMapping objects in the collection.

public:
 property int Count { int get(); };
[System.ComponentModel.Browsable(false)]
[System.Data.DataSysDescription("DataTableMappings_Count")]
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

プロパティ値

コレクションに含まれる DataTableMapping オブジェクトの数。The number of DataTableMapping objects in the collection.

実装

次の例では、作成、 DataTableMappingCollection、追加DataTableMappingをコレクションにオブジェクトし、のマップされたソース テーブルの一覧を表示します。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);
}
Public Sub CreateTableMappings()
    Dim mappings As New DataTableMappingCollection()
    mappings.Add("Categories", "DataCategories")
    mappings.Add("Orders", "DataOrders")
    mappings.Add("Products", "DataProducts")
    Dim message As String = "TableMappings:" + ControlChars.Cr
    Dim i As Integer
    For i = 0 To mappings.Count - 1
        message &= i.ToString() & " " & mappings(i).ToString() _
           & ControlChars.Cr
    Next i
    Console.WriteLine(message)
End Sub

適用対象