System.Data.SqlClient.SqlBulkCopyColumnMapping Class

Defines the mapping between a column in a System.Data.SqlClient.SqlBulkCopy instance's data source and a column in the instance's destination table.

See Also: SqlBulkCopyColumnMapping Members

Syntax

public sealed class SqlBulkCopyColumnMapping

Remarks

Column mappings define the mapping between data source and the target table.

If mappings are not defined—that is, the SqlBulkCopy.ColumnMappings collection is empty—the columns are mapped implicitly based on ordinal position. For this to work, source and target schemas must match. If they do not, an InvalidOperationException will be thrown.

If the SqlBulkCopy.ColumnMappings collection is not empty, not every column present in the data source has to be specified. Those not mapped by the collection are ignored.

You can refer to source and target columns by either name or ordinal. You can also mix by-name and by-ordinal column references in the same mappings collection.

Requirements

Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0