共用方式為


ITableMapping.ColumnMappings 屬性

定義

DataColumnMappingCollection 取得衍生的 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

屬性值

資料行對應的集合。

範例

下列範例會建立衍生類別 DataTableMapping的實例、設定其部分屬性,並將其複製到 ColumnMappings 陣列。 這個範例假設 DataColumnMappingCollection 已建立 。

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

適用於