Freigeben über


DataColumnMappingCollection-Klasse

Enthält eine Auflistung von DataColumnMapping-Objekten.

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

Syntax

'Declaration
Public NotInheritable Class DataColumnMappingCollection
    Inherits MarshalByRefObject
    Implements IColumnMappingCollection, IList, ICollection, IEnumerable
'Usage
Dim instance As DataColumnMappingCollection
public sealed class DataColumnMappingCollection : MarshalByRefObject, IColumnMappingCollection, IList, ICollection, 
    IEnumerable
public ref class DataColumnMappingCollection sealed : public MarshalByRefObject, IColumnMappingCollection, IList, ICollection, 
    IEnumerable
public final class DataColumnMappingCollection extends MarshalByRefObject implements IColumnMappingCollection, IList, 
    ICollection, IEnumerable
public final class DataColumnMappingCollection extends MarshalByRefObject implements IColumnMappingCollection, IList, 
    ICollection, IEnumerable

Beispiel

Im folgenden Beispiel wird eine DataTableMapping verwendet, um der zugehörigen ColumnMappings-Auflistung mehrere DataColumnMapping-Objekte mithilfe von Add hinzuzufügen. Anschließend wird eine Liste dieser zugeordneten Quellspalten angezeigt. In diesem Beispiel wird davon ausgegangen, dass bereits eine DataTableMapping-Klasse erstellt wurde.

Public Sub ShowColumnMappings()
    ' ...
    ' create tableMapping
    ' ...
    tableMapping.ColumnMappings.Add( _
       "Category Name", "DataCategory")
    tableMapping.ColumnMappings.Add( _
       "Description", "DataDescription")
    tableMapping.ColumnMappings.Add( _
       "Picture", "DataPicture")
    Console.WriteLine("Column Mappings:")
    Dim i As Integer
    For i = 0 To tableMapping.ColumnMappings.Count - 1
        Console.WriteLine("  {0} {1}", i, _
           tableMapping.ColumnMappings(i).ToString())
    Next i
End Sub
public void ShowColumnMappings() 
{
    // ...
    // create tableMapping
    // ...
    tableMapping.ColumnMappings.Add("Category Name","DataCategory");
    tableMapping.ColumnMappings.Add("Description","DataDescription");
    tableMapping.ColumnMappings.Add("Picture","DataPicture");
    Console.WriteLine("Column Mappings");
    for(int i=0;i < tableMapping.ColumnMappings.Count;i++) 
    {
        Console.WriteLine("  {0} {1}", i,
            tableMapping.ColumnMappings[i].ToString());
    }
}

Vererbungshierarchie

System.Object
   System.MarshalByRefObject
    System.Data.Common.DataColumnMappingCollection

Threadsicherheit

Alle öffentlichen statischen (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

DataColumnMappingCollection-Member
System.Data.Common-Namespace