Add(int, string)

This method creates and adds an OracleBulkCopyColumnMapping object to the collection using the supplied source column ordinal and destination column name.

Declaration

// C#
public OracleBulkCopyColumnMapping Add(int sourceColumnIndex,
    string destinationColumn);

Parameters

Exceptions

InvalidOperationException - The bulk copy operation is in progress.

Return Value

The newly created OracleBulkCopyColumnMapping object that was added to the collection.

Remarks

It is not necessary to specify column mappings for all the columns in the data source. If a ColumnMapping is not specified, then, by default, columns are mapped based on the ordinal position. This succeeds only if the source and destination table schema match. If there is a mismatch, an InvalidOperationException is thrown.

All the mappings in a mapping collection must be by name or ordinal position. Note: Oracle Data Provider for .NET makes one or more round trips to the database to determine the column names if the mapping is specified by ordinal resulting in a performance overhead. Therefore, it is recommended to specify the mapping by column names.

  <div class="infoboxnote" markdown="1">

  **See Also:**

  - "[Oracle.DataAccess.Client and Oracle.ManagedDataAccess.Client Namespaces](intro003.html#GUID-2A5A5F0B-E6C9-45AF-9477-FBD55F7FCDC5)"

  - [OracleBulkCopyColumnMappingCollection Class](OracleBulkCopyColumnMappingCollectionClass.html#GUID-B0A74151-D3DA-4A28-BA41-7EE7980AA763)

  - [OracleBulkCopyColumnMappingCollection Members](OracleBulkCopyColumnMappingCollectionMembers.html#GUID-F408E85D-B1D0-4CF0-95EF-2432209529E8)

  </div>