The given ColumnMapping does not match up with any column in the source or destination

Once I was working with SqlBulkCopy I was getting below error:
"The given ColumnMapping does not match up with any column in the source or destination."
If you are also facing the same issue, you need to look into below points.

1. Do you have TimeStamp columns in your table? Or do you have identity columns? If you have identity columns, you need to specify SqlBulkCopyOptions.KeepIdentity as shown below
SqlBulkCopy copy = new SqlBulkCopy("Your Connection String", SqlBulkCopyOptions.KeepIdentity)
2. If your Column name is "Address" and you are using it as "ADDRESS" then it is wrong, as columns on SQL Server 2005 are case sensitive.


Reference: Muthukumar (http://nadarmuthukumar.blogspot.in/)

0 comments:

Twitter Delicious Facebook Digg Stumbleupon Favorites More