| |||||||||||||||||||||||||||||||||||||||||||||||
DataColumnMapping ClassRepresents the mapping between a field in a data source and its linked DataColumn in a DataSet.
|
|||||||||||||||||||||||||||||||||||||||||||||||
| Visibility | Name | Value Type | Accessibility |
|---|---|---|---|
| public | DataSetColumn | String | [ Get , Set ] |
| public | SourceColumn | String | [ Get , Set ] |
| 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 |
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.
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 | |
DataColumnMappingCollection DataTableMapping DataTableMappingCollection
Check out related books at Amazon
© 2000-2008 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 aspxtreme