asp.net.ph

DataTableMapping GetColumnMappingBySchemaAction Method

System.Data.Common Namespace   DataTableMapping Class


Returns a DataColumnMapping with the specified SourceColumn name and MissingMappingAction.

[ VB ]
Public Function GetColumnMappingBySchemaAction ( _
   ByVal sourceColumn As String, _
   ByVal mappingAction As MissingMappingAction _
) As DataColumnMapping

[ C# ]
public DataColumnMapping GetColumnMappingBySchemaAction (
   string sourceColumn,
   MissingMappingAction mappingAction
);

[ C++ ]
public: DataColumnMapping* GetColumnMappingBySchemaAction (
   String* sourceColumn,
   MissingMappingAction mappingAction
);

[ JScript ]
public function GetColumnMappingBySchemaAction (
   columnMappings : DataTableMapping,
   sourceColumn : String,
   mappingAction : MissingMappingAction
) : DataColumnMapping;

Parameters

sourceColumn
The case-sensitive name of a SourceColumn to find.
mappingAction
One of the MissingMappingAction values.

Return Value

A DataColumnMapping object.

Remarks

If the DataColumnMapping exists, it is returned. Otherwise, for a given MissingMappingAction, the following happens:

MissingMappingAction Action Taken
Passthrough This method initializes a DataColumnMapping with the given source column name as both the source column name and the DataSet column name. This DataColumnMapping is not added to the collection.
Error An exception is generated.
Ignore Gets a null.

Example

The following example demonstrates using the GetColumnMappingBySchemaAction method to return a specified DataColumnMapping object.

public void FindDataTableMapping ( DataTableMapping myTable ) {
   // get column mappings
   DataColumnMappingCollection myFields = myTable.ColumnMappings;
   if ( myFields.Contains ( "Description" ) ) {
      DataColumnMapping myField = 
         myTable.GetColumnMappingBySchemaAction 
            ( "Description", MissingMappingAction.Ignore );
   }
}
  C# VB

See Also

DataTableMapping Members 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