Bagikan melalui


DataTableMapping Konstruktor

Definisi

Menginisialisasi instans baru kelas DataTableMapping.

Overload

DataTableMapping()

Menginisialisasi instans baru kelas DataTableMapping.

DataTableMapping(String, String)

Menginisialisasi instans DataTableMapping baru kelas dengan sumber saat diberi nama tabel sumber dan DataTable nama.

DataTableMapping(String, String, DataColumnMapping[])

Menginisialisasi instans DataTableMapping baru kelas saat diberi nama tabel sumber, DataTable nama, dan array DataColumnMapping objek.

DataTableMapping()

Sumber:
DataTableMapping.cs
Sumber:
DataTableMapping.cs
Sumber:
DataTableMapping.cs

Menginisialisasi instans baru kelas DataTableMapping.

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

Contoh

Contoh berikut membuat DataTableMapping objek.

public void CreateDataTableMapping()
{
    DataTableMapping mapping = new DataTableMapping();
    mapping.SourceTable = "Categories";
    mapping.DataSetTable = "DataCategories";
}
Public Sub CreateDataTableMapping()
    Dim mapping As New DataTableMapping()
    mapping.SourceTable = "Categories"
    mapping.DataSetTable = "DataCategories"
End Sub

Lihat juga

Berlaku untuk

DataTableMapping(String, String)

Sumber:
DataTableMapping.cs
Sumber:
DataTableMapping.cs
Sumber:
DataTableMapping.cs

Menginisialisasi instans DataTableMapping baru kelas dengan sumber saat diberi nama tabel sumber dan DataTable nama.

public:
 DataTableMapping(System::String ^ sourceTable, System::String ^ dataSetTable);
public DataTableMapping (string? sourceTable, string? dataSetTable);
public DataTableMapping (string sourceTable, string dataSetTable);
new System.Data.Common.DataTableMapping : string * string -> System.Data.Common.DataTableMapping
Public Sub New (sourceTable As String, dataSetTable As String)

Parameter

sourceTable
String

Nama tabel sumber peka huruf besar/kecil dari sumber data.

dataSetTable
String

Nama tabel dari ke DataSet peta ke.

Contoh

Contoh berikut membuat DataTableMapping objek dan mengatur beberapa propertinya.

public void CreateDataTableMapping()
{
    DataTableMapping mapping =
        new DataTableMapping("Categories","DataCategories");
}
Public Sub CreateDataTableMapping()
    Dim mapping As New DataTableMapping("Categories", "DataCategories")
End Sub

Lihat juga

Berlaku untuk

DataTableMapping(String, String, DataColumnMapping[])

Sumber:
DataTableMapping.cs
Sumber:
DataTableMapping.cs
Sumber:
DataTableMapping.cs

Menginisialisasi instans DataTableMapping baru kelas saat diberi nama tabel sumber, DataTable nama, dan array DataColumnMapping objek.

public:
 DataTableMapping(System::String ^ sourceTable, System::String ^ dataSetTable, cli::array <System::Data::Common::DataColumnMapping ^> ^ columnMappings);
public DataTableMapping (string? sourceTable, string? dataSetTable, System.Data.Common.DataColumnMapping[]? columnMappings);
public DataTableMapping (string sourceTable, string dataSetTable, System.Data.Common.DataColumnMapping[] columnMappings);
new System.Data.Common.DataTableMapping : string * string * System.Data.Common.DataColumnMapping[] -> System.Data.Common.DataTableMapping
Public Sub New (sourceTable As String, dataSetTable As String, columnMappings As DataColumnMapping())

Parameter

sourceTable
String

Nama tabel sumber peka huruf besar/kecil dari sumber data.

dataSetTable
String

Nama tabel dari ke DataSet peta ke.

columnMappings
DataColumnMapping[]

Array DataColumnMapping objek.

Contoh

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

public void CreateDataTableMapping()
{
    // ...
    // create mappings
    // ...

    DataColumnMapping[] columns1 = {};
    mappings.CopyTo(columns1, 0);
    DataTableMapping mapping =
        new DataTableMapping("Categories", "DataCategories", columns1);

    DataColumnMapping[] columns2 = {};
    mapping.ColumnMappings.CopyTo(columns2, 0);
}
Public Sub CreateDataTableMapping()
    ' ...
    ' create mappings
    ' ...
    Dim columns1() As DataColumnMapping
    mappings.CopyTo(columns1, 0)
    Dim mapping As New DataTableMapping _
       ("Categories", "DataCategories", columns1)
       
    Dim columns2() As DataColumnMapping
    mapping.ColumnMappings.CopyTo(columns2, 0)
End Sub

Lihat juga

Berlaku untuk