DataColumnMappingCollection.Count Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the number of DataColumnMapping objects in the collection.
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
Property Value
The number of items in the collection.
Implements
- Attributes
Examples
The following example creates a DataColumnMappingCollection collection, adds DataColumnMapping objects to the collection, and displays a list of the mapped source columns.
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
Applies to
See also
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.