Bagikan melalui


ITableMapping.ColumnMappings Properti

Definisi

Mendapatkan turunan DataColumnMappingCollection untuk DataTable.

public:
 property System::Data::IColumnMappingCollection ^ ColumnMappings { System::Data::IColumnMappingCollection ^ get(); };
public System.Data.IColumnMappingCollection ColumnMappings { get; }
member this.ColumnMappings : System.Data.IColumnMappingCollection
Public ReadOnly Property ColumnMappings As IColumnMappingCollection

Nilai Properti

Kumpulan pemetaan kolom data.

Contoh

Contoh berikut membuat instans kelas turunan, DataTableMapping, mengatur beberapa propertinya, dan menyalinnya ColumnMappings ke array. Contoh ini mengasumsikan bahwa telah DataColumnMappingCollection dibuat.

public void CreateDataTableMapping()
{
    // ...
    // create mappings
    // ...
    DataColumnMapping[] columns = {};
    // Copy mappings to array
    mappings.CopyTo(columns, 0);
    DataTableMapping mapping =
        new DataTableMapping("Categories", "DataCategories", columns);
}
Public Sub CreateDataTableMapping()
    ' ...
    ' create mappings
    ' ...
    Dim columns() As DataColumnMapping
    ' Copy mappings to array
    mappings.CopyTo(columns, 0)
    Dim mapping As New DataTableMapping _
       ("Categories", "DataCategories", columns)
End Sub

Berlaku untuk