Прочетете на английски Редактиране

Споделяне чрез


DataTableMapping Constructors

Definition

Initializes a new instance of the DataTableMapping class.

Overloads

DataTableMapping()

Initializes a new instance of the DataTableMapping class.

DataTableMapping(String, String)

Initializes a new instance of the DataTableMapping class with a source when given a source table name and a DataTable name.

DataTableMapping(String, String, DataColumnMapping[])

Initializes a new instance of the DataTableMapping class when given a source table name, a DataTable name, and an array of DataColumnMapping objects.

DataTableMapping()

Source:
DataTableMapping.cs
Source:
DataTableMapping.cs
Source:
DataTableMapping.cs

Initializes a new instance of the DataTableMapping class.

C#
public DataTableMapping();

Examples

The following example creates a DataTableMapping object.

C#
public void CreateDataTableMapping()
{
    DataTableMapping mapping = new DataTableMapping();
    mapping.SourceTable = "Categories";
    mapping.DataSetTable = "DataCategories";
}

See also

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

DataTableMapping(String, String)

Source:
DataTableMapping.cs
Source:
DataTableMapping.cs
Source:
DataTableMapping.cs

Initializes a new instance of the DataTableMapping class with a source when given a source table name and a DataTable name.

C#
public DataTableMapping(string? sourceTable, string? dataSetTable);
C#
public DataTableMapping(string sourceTable, string dataSetTable);

Parameters

sourceTable
String

The case-sensitive source table name from a data source.

dataSetTable
String

The table name from a DataSet to map to.

Examples

The following example creates a DataTableMapping object and sets some of its properties.

C#
public void CreateDataTableMapping()
{
    DataTableMapping mapping =
        new DataTableMapping("Categories","DataCategories");
}

See also

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

DataTableMapping(String, String, DataColumnMapping[])

Source:
DataTableMapping.cs
Source:
DataTableMapping.cs
Source:
DataTableMapping.cs

Initializes a new instance of the DataTableMapping class when given a source table name, a DataTable name, and an array of DataColumnMapping objects.

C#
public DataTableMapping(string? sourceTable, string? dataSetTable, System.Data.Common.DataColumnMapping[]? columnMappings);
C#
public DataTableMapping(string sourceTable, string dataSetTable, System.Data.Common.DataColumnMapping[] columnMappings);

Parameters

sourceTable
String

The case-sensitive source table name from a data source.

dataSetTable
String

The table name from a DataSet to map to.

columnMappings
DataColumnMapping[]

An array of DataColumnMapping objects.

Examples

The following example creates a DataTableMapping object, sets some of its properties, and copies its ColumnMappings to an array. This example assumes that a DataColumnMappingCollection has been created.

C#
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);
}

See also

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1