This topic has not yet been rated - Rate this topic

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.

  Name Description
Public method Supported by the XNA Framework DataTableMapping() Initializes a new instance of the DataTableMapping class.
Public method Supported by the XNA Framework DataTableMapping(String, String) Initializes a new instance of the DataTableMapping class with a source when given a source table name and a DataTable name.
Public method Supported by the XNA Framework 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.
Top
  Name Description
Public property Supported by the XNA Framework ColumnMappings Gets the DataColumnMappingCollection for the DataTable.
Public property Supported by the XNA Framework DataSetTable Gets or sets the table name from a DataSet.
Public property Supported by the XNA Framework SourceTable Gets or sets the case-sensitive source table name from a data source.
Top
  Name Description
Public method CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method Supported by the XNA Framework Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Supported by the XNA Framework Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Supported by the XNA Framework GetColumnMappingBySchemaAction Gets a DataColumn from the specified DataTable using the specified MissingMappingAction value and the name of the DataColumn.
Public method Supported by the XNA Framework GetDataColumn Returns a DataColumn object for a given column name.
Public method Supported by the XNA Framework GetDataTableBySchemaAction Gets the current DataTable for the specified DataSet using the specified MissingSchemaAction value.
Public method Supported by the XNA Framework GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method Supported by the XNA Framework GetType Gets the Type of the current instance. (Inherited from Object.)
Public method InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected method Supported by the XNA Framework MemberwiseClone() Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method MemberwiseClone(Boolean) Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Public method Supported by the XNA Framework ToString Converts the current SourceTable name to a string. (Overrides Object.ToString().)
Top
  Name Description
Explicit interface implemetation Private method Supported by the XNA Framework ICloneable.Clone Creates a new object that is a copy of the current instance.
Explicit interface implemetation Private property Supported by the XNA Framework ITableMapping.ColumnMappings Gets 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.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ