System.Data.Common.DataColumnMappingCollection.GetColumnMappingBySchemaAction Method

Gets a System.Data.Common.DataColumnMapping for the specified System.Data.Common.DataColumnMappingCollection, source column name, and System.Data.MissingMappingAction.

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
public static DataColumnMapping GetColumnMappingBySchemaAction (DataColumnMappingCollection columnMappings, string sourceColumn, System.Data.MissingMappingAction mappingAction)

Parameters

columnMappings
The System.Data.Common.DataColumnMappingCollection.
sourceColumn
The case-sensitive source column name to find.
mappingAction
One of the System.Data.MissingMappingAction values.

Returns

A System.Data.Common.DataColumnMapping object.

Remarks

If the System.Data.Common.DataColumnMapping exists in the collection, it is returned.

If the System.Data.Common.DataColumnMapping does not exist in the collection, for a given System.Data.MissingMappingAction, the following actions occur:

Passthrough

Creates a System.Data.Common.DataColumnMapping with the specified source column name as both the source column name and the System.Data.DataSet column name. This System.Data.Common.DataColumnMapping is not added to the collection.

Error

An InvalidOperationException is generated if the specified column mapping is missing.

Ignore

Gets a null value.

Requirements

Namespace: System.Data.Common
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0