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)

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

public sealed class DataColumnMapping : MarshalByRefObject, IColumnMapping, 
	ICloneable

NameDescription
System_CAPS_pubmethodDataColumnMapping()

Initializes a new instance of the DataColumnMapping class.

System_CAPS_pubmethodDataColumnMapping(String, String)

Initializes a new instance of the DataColumnMapping class with the specified source column name and DataSet column name to map to.

NameDescription
System_CAPS_pubpropertyDataSetColumn

Gets or sets the name of the column within the DataSet to map to.

System_CAPS_pubpropertySourceColumn

Gets or sets the name of the column within the data source to map from. The name is case-sensitive.

NameDescription
System_CAPS_pubmethodCreateObjRef(Type)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetDataColumnBySchemaAction(DataTable, Type, MissingSchemaAction)

Gets a DataColumn from the given DataTable using the MissingSchemaAction and the DataSetColumn property.

System_CAPS_pubmethodSystem_CAPS_staticGetDataColumnBySchemaAction(String, String, DataTable, Type, MissingSchemaAction)

A static version of GetDataColumnBySchemaAction that can be called without instantiating a DataColumnMapping object.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodInitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodToString()

Converts the current SourceColumn name to a string.(Overrides Object.ToString().)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodICloneable.Clone()

Creates a new object that is a copy of the current instance.

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.

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

.NET Framework
Available since 1.1

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

Return to top
Show: