共用方式為


DataTableMapping.ColumnMappings 屬性

定義

public:
 property System::Data::Common::DataColumnMappingCollection ^ ColumnMappings { System::Data::Common::DataColumnMappingCollection ^ get(); };
public System.Data.Common.DataColumnMappingCollection ColumnMappings { get; }
[System.Data.DataSysDescription("DataTableMapping_ColumnMappings")]
public System.Data.Common.DataColumnMappingCollection ColumnMappings { get; }
member this.ColumnMappings : System.Data.Common.DataColumnMappingCollection
[<System.Data.DataSysDescription("DataTableMapping_ColumnMappings")>]
member this.ColumnMappings : System.Data.Common.DataColumnMappingCollection
Public ReadOnly Property ColumnMappings As DataColumnMappingCollection

屬性值

資料行對應集合。

屬性

範例

下列範例會 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

適用於

另請參閱