GetColumnMappingBySchemaAction Method

DataColumnMappingCollection.GetColumnMappingBySchemaAction Method (DataColumnMappingCollection, String, MissingMappingAction)


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

Namespace:   System.Data.Common
Assembly:  System.Data (in System.Data.dll)

static member GetColumnMappingBySchemaAction : 
        columnMappings:DataColumnMappingCollection *
        sourceColumn:string *
        mappingAction:MissingMappingAction -> DataColumnMapping


Type: System.Data.Common.DataColumnMappingCollection

The DataColumnMappingCollection.

Type: System.String

The case-sensitive source column name to find.

Type: System.Data.MissingMappingAction

One of the MissingMappingAction values.

Exception Condition

The mappingAction parameter was set to Error, and no mapping was specified.

If the DataColumnMapping exists in the collection, it is returned.

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


Action Taken


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


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


Gets a null value.

The following example searches for a DataColumnMapping with the given source column name within the collection. If the object exists, it is returned. The example assumes that a DataColumnMappingCollection collection and a DataColumnMapping object have been created.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
© 2016 Microsoft