Breyta

Deila með


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.

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

Examples

The following example creates a DataTableMapping object.

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

See also

Applies to

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.

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)

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.

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

See also

Applies to

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.

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())

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.

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

See also

Applies to