DataColumnMappingCollection.Count 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得集合中 DataColumnMapping 物件的數目。
public:
property int Count { int get(); };
[System.ComponentModel.Browsable(false)]
public int Count { get; }
[System.ComponentModel.Browsable(false)]
[System.Data.DataSysDescription("DataColumnMappings_Count")]
public int Count { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Count : int
[<System.ComponentModel.Browsable(false)>]
[<System.Data.DataSysDescription("DataColumnMappings_Count")>]
member this.Count : int
Public ReadOnly Property Count As Integer
屬性值
集合中的項目數目
實作
- 屬性
範例
下列範例會 DataColumnMappingCollection 建立集合、將 物件加入 DataColumnMapping 至集合,並顯示對應的源數據行清單。
public void CreateColumnMappings()
{
DataColumnMappingCollection mappings =
new DataColumnMappingCollection();
mappings.Add("Category Name","DataCategory");
mappings.Add("Description","DataDescription");
mappings.Add("Picture","DataPicture");
string message = "ColumnMappings:\n";
for(int i=0;i < mappings.Count;i++)
{
message += i.ToString() + " "
+ mappings[i].ToString() + "\n";
}
Console.WriteLine(message);
}
Public Sub CreateColumnMappings()
Dim mappings As New DataColumnMappingCollection()
mappings.Add("Category Name", "DataCategory")
mappings.Add("Description", "DataDescription")
mappings.Add("Picture", "DataPicture")
Dim message As String = "ColumnMappings:" + 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
適用於
另請參閱
- ADO.NET 概觀 \(部分機器翻譯\)