asp.net.ph

IColumnMapping Interface

System.Data Namespace


Associates a data source column with a DataSet column, and is implemented by the DataColumnMapping class, which is used in common by .NET data providers.

IColumnMapping Interface Members

Collapse   Properties

Visibility Name Value Type Accessibility
public DataSetColumn String [ Get , Set ]
public SourceColumn String [ Get , Set ]

Classes that Implement IColumnMapping


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

Remarks

The IColumnMapping interface allows an inheriting class to implement a ColumnMapping class, which associates a data source column with a DataSet column. For more information, see Setting Up DataTable and DataColumn Mappings.

An application does not create an instance of the IColumnMapping interface directly, but initializes an instance of a class that inherits IColumnMapping.

Classes that inherit IColumnMapping must implement the inherited members, and typically define additional members to add provider-specific functionality. For example, the IColumnMapping interface defines the DataSetColumn property. In turn, the DataColumnMapping class inherits this property, and also defines the GetDataColumnBySchemaAction method.

Notes to Implementers: When you inherit from the IColumnMapping interface, you should implement the following constructors:


Item Description
DataColumnMapping ( ) Initializes a new instance of the ColumnMapping class.
ColumnMapping ( string sourceColumn, string dataSetColumn ) Initializes a new instance of the ColumnMapping class with a source when given a source column name and a DataSet column name to map.

Example

The following example initializes an instance of the derived class, DataColumnMapping, and adds it to a DataColumnMappingCollection . It then tells the user that the mapping was added to the collection and shows the mapping' s Parent.

void AddDataColumnMapping ( ) {

   // ... create myColumnMappings ...
   DataColumnMapping myNewMapping = new DataColumnMapping
      ( "Description","DataDescription" );
   myColumnMappings.Add ( ( Object ) myNewMapping );
   Response.Write ( "column " + myNewMapping.ToString ( ) +
      " added to " + 
      "column mapping collection " + myColumnMappings.ToString ( ) );
}
  C# VB

Skip Navigation Links



Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph