DataColumnMappingCollection Constructeur

Définition

public:
 DataColumnMappingCollection();
public DataColumnMappingCollection ();
Public Sub New ()

Exemples

L’exemple suivant crée une DataColumnMappingCollection collection, ajoute DataColumnMapping des objets à la collection et affiche une liste des colonnes sources mappées.

public void CreateColumnMappings()
{
    DataColumnMappingCollection mappings =
        new DataColumnMappingCollection();
    mappings.Add("Category Name","DataCategory");
    mappings.Add("Description","DataDescription");
    mappings.Add("Picture","DataPicture");
    string myMessage = "ColumnMappings:\n";
    for(int i=0;i < mappings.Count;i++)
    {
        myMessage += i.ToString() + " "
            + mappings[i].ToString() + "\n";
    }
    Console.WriteLine(myMessage);
}
Public Sub CreateColumnMappings()
    Dim mappings As New DataColumnMappingCollection()
    mappings.Add("Category Name", "DataCategory")
    mappings.Add("Description", "DataDescription")
    mappings.Add("Picture", "DataPicture")
    Dim myMessage As String = "ColumnMappings:" + ControlChars.Cr
    Dim i As Integer
    For i = 0 To mappings.Count - 1
        myMessage += i.ToString() + " " + mappings(i).ToString() _
           + ControlChars.Cr
    Next i
    Console.WriteLine(myMessage)
End Sub

S’applique à

Voir aussi