System.Data.SqlClient.SqlBulkCopyColumnMappingCollection Class

Collection of System.Data.SqlClient.SqlBulkCopyColumnMapping objects that inherits from CollectionBase.

See Also: SqlBulkCopyColumnMappingCollection Members

Syntax

public sealed class SqlBulkCopyColumnMappingCollection : CollectionBase

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 is 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 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