asp.net.ph

DataColumnMapping Class

System.Data.Common Namespace


Represents the mapping between a field in a data source and its linked DataColumn in a DataSet.

DataColumnMapping Class Members

Collapse   Constructors

Visibility Constructor Parameters
public DataColumnMapping ( )
public DataColumnMapping ( String sourceColumn , String dataSetColumn )

Collapse   Properties

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

Collapse   Methods

Visibility Name Parameters Return Type
public static GetDataColumnBySchemaAction ( String sourceColumn , String dataSetColumn , DataTable dataTable , Type dataType , MissingSchemaAction schemaAction ) DataColumn
public GetDataColumnBySchemaAction ( DataTable dataTable , Type dataType , MissingSchemaAction schemaAction ) DataColumn
public ToString ( ) String

Remarks

A DataColumnMapping provides a mapping between a field in a table in the data source, and a DataColumn in a DataTable that contains the results of the query issued against the data source. This class is used by a DataAdapter when populating a DataSet.

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 Setting Up DataTable and DataColumn Mappings.

Example

The following example initializes a DataColumnMapping object and adds it to a DataColumnMappingCollection.

void AddDataColumnMapping ( DataTableMapping myTableMap ) {
   // get column mappings
   DataColumnMappingCollection myFieldsMaps = myTableMap.ColumnMappings;
   DataColumnMapping myMap = new DataColumnMapping ( "Description", "DataDescription" );
   myFieldsMaps.Add ( ( Object ) myMap );
   Response.Write ( "column " + myMap.ToString ( ) + " added to " +
      "column mapping collection " + myFieldsMaps.ToString ( ) );
}
  C# VB

See Also

DataColumnMappingCollection   DataTableMapping   DataTableMappingCollection 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