Export (0) Print
Expand All

DataColumnMapping Class

Contains a generic column mapping for an object that inherits from DataAdapter. This class cannot be inherited.

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

public sealed class DataColumnMapping : MarshalByRefObject, 
	IColumnMapping, ICloneable

A DataColumnMapping enables you to use column names in a DataTable that are different from those in the data source. The DataAdapter uses the mapping to match the columns when the tables in the DataSet or data source are updated. For more information, see DataAdapter DataTable and DataColumn Mappings (ADO.NET).

The following example creates a DataColumnMapping object and adds it to a DataColumnMappingCollection. It then tells the user that the mapping was added to the collection and shows the Parent for the mapping.

public void AddDataColumnMapping() {
   // ... 
   // create columnMappings 
   // ...
   DataColumnMapping mapping =
      new DataColumnMapping("Description","DataDescription");
   columnMappings.Add((Object) mapping);
   Console.WriteLine("Column {0} added to column mapping collection {1}.", 
       mapping.ToString(), columnMappings.ToString());
}

System.Object
  System.MarshalByRefObject
    System.Data.Common.DataColumnMapping

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune

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

.NET Framework

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

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

XNA Framework

Supported in: 3.0, 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft