DataColumnMapping DataColumnMapping DataColumnMapping DataColumnMapping Class

Definition

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

public ref class DataColumnMapping sealed : MarshalByRefObject, ICloneable, System::Data::IColumnMapping
[System.ComponentModel.TypeConverter(typeof(System.Data.Common.DataColumnMapping/DataColumnMappingConverter))]
[System.ComponentModel.TypeConverter(typeof(System.Data.Common.DataColumnMappingConverter))]
public sealed class DataColumnMapping : MarshalByRefObject, ICloneable, System.Data.IColumnMapping
type DataColumnMapping = class
    inherit MarshalByRefObject
    interface IColumnMapping
    interface ICloneable
Public NotInheritable Class DataColumnMapping
Inherits MarshalByRefObject
Implements ICloneable, IColumnMapping
Inheritance
DataColumnMappingDataColumnMappingDataColumnMappingDataColumnMapping
Attributes
Implements

Examples

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());
}
Public Sub AddDataColumnMapping()
    ' ...
    ' create columnMappings
    ' ...
    Dim mapping As New DataColumnMapping( _
       "Description", "DataDescription")
    columnMappings.Add(CType(mapping, Object))
    Console.WriteLine("Column {0} added to column mapping collection {1}.", _
       mapping.ToString(), columnMappings.ToString())
End Sub

Remarks

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.

Constructors

DataColumnMapping() DataColumnMapping() DataColumnMapping() DataColumnMapping()

Initializes a new instance of the DataColumnMapping class.

DataColumnMapping(String, String) DataColumnMapping(String, String) DataColumnMapping(String, String) DataColumnMapping(String, String)

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

Properties

DataSetColumn DataSetColumn DataSetColumn DataSetColumn

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

SourceColumn SourceColumn SourceColumn SourceColumn

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

Methods

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(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)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetDataColumnBySchemaAction(DataTable, Type, MissingSchemaAction) GetDataColumnBySchemaAction(DataTable, Type, MissingSchemaAction) GetDataColumnBySchemaAction(DataTable, Type, MissingSchemaAction) GetDataColumnBySchemaAction(DataTable, Type, MissingSchemaAction)

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

GetDataColumnBySchemaAction(String, String, DataTable, Type, MissingSchemaAction) GetDataColumnBySchemaAction(String, String, DataTable, Type, MissingSchemaAction) GetDataColumnBySchemaAction(String, String, DataTable, Type, MissingSchemaAction) GetDataColumnBySchemaAction(String, String, DataTable, Type, MissingSchemaAction)

A static version of GetDataColumnBySchemaAction(DataTable, Type, MissingSchemaAction) that can be called without instantiating a DataColumnMapping object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString() ToString() ToString() ToString()

Converts the current SourceColumn name to a string.

Explicit Interface Implementations

ICloneable.Clone() ICloneable.Clone() ICloneable.Clone() ICloneable.Clone()

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

Applies to

See Also