Add(string, int)
This method creates and adds an OracleBulkCopyColumnMapping object to the collection using the supplied source column name and destination column ordinal.
Declaration
// C#
public OracleBulkCopyColumnMapping Add(string sourceColumn,
int destinationColumnIndex);
Parameters
-
sourceColumn
The name of the source column within the data source.
-
destinationColumnIndex
The ordinal position of the destination column within the destination table.
Return Value
The newly created OracleBulkCopyColumnMapping object that was added to the collection.
Exceptions
InvalidOperationException - The bulk copy operation is in progress.
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>