Export (0) Print
Expand All

DataTableMapping Class

Contains a description of a mapped relationship between a source table and a DataTable. This class is used by a DataAdapter when populating a DataSet.

System.Object
  System.MarshalByRefObject
    System.Data.Common.DataTableMapping

Namespace:  System.Data.Common
Assembly:  System.Data (in System.Data.dll)

public sealed class DataTableMapping : MarshalByRefObject, 
	ITableMapping, ICloneable

The DataTableMapping type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkDataTableMapping()Initializes a new instance of the DataTableMapping class.
Public methodSupported by the XNA FrameworkDataTableMapping(String, String)Initializes a new instance of the DataTableMapping class with a source when given a source table name and a DataTable name.
Public methodSupported by the XNA FrameworkDataTableMapping(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.
Top

  NameDescription
Public propertySupported by the XNA FrameworkColumnMappingsGets the DataColumnMappingCollection for the DataTable.
Public propertySupported by the XNA FrameworkDataSetTableGets or sets the table name from a DataSet.
Public propertySupported by the XNA FrameworkSourceTableGets or sets the case-sensitive source table name from a data source.
Top

  NameDescription
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public methodSupported by the XNA FrameworkEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetColumnMappingBySchemaActionGets a DataColumn from the specified DataTable using the specified MissingMappingAction value and the name of the DataColumn.
Public methodSupported by the XNA FrameworkGetDataColumnReturns a DataColumn object for a given column name.
Public methodSupported by the XNA FrameworkGetDataTableBySchemaActionGets the current DataTable for the specified DataSet using the specified MissingSchemaAction value.
Public methodSupported by the XNA FrameworkGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected methodSupported by the XNA FrameworkMemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
Protected methodMemberwiseClone(Boolean)Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Public methodSupported by the XNA FrameworkToStringConverts the current SourceTable name to a string. (Overrides Object.ToString().)
Top

  NameDescription
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkICloneable.CloneCreates a new object that is a copy of the current instance.
Explicit interface implemetationPrivate propertySupported by the XNA FrameworkITableMapping.ColumnMappingsGets the derived DataColumnMappingCollection for the DataTable.
Top

A DataTableMapping provides a master mapping between the data returned from a query against a data source, and a DataTable. The DataTableMapping name can be passed in place of the DataTable name to the Fill method of the DataAdapter. For more information, see DataAdapter DataTable and DataColumn Mappings (ADO.NET).

The following example creates a DataTableMapping object and adds it to a DataTableMappingCollection. It then informs the user that the mapping was added to the collection and displays the parent mapping.


public void AddDataTableMapping() 
{
    // ...
    // create tableMappings
    // ...
    DataTableMapping mapping =
        new DataTableMapping("Categories","DataCategories");
    tableMappings.Add((Object) mapping);
    Console.WriteLine("Table {0} added to {1} table mapping collection.",
        mapping.ToString(), tableMappings.ToString());
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft