locked
SqlBulkCopy problem RRS feed

  • Question

  • Using SqlBulkCopy to bulk copy tables from DBASE to SQL server. An error occurs during  copying one of tables. The error is "The given ColumnMapping does not match up with any column in the source or destination.". I checked column mapping is fine. Also, all other tables are ok. This table has 138 columns. Not sure if SqlBulkCopy have limitation on the number of columns? Did anyone have the same problem? Any idea?

    Thanks
    Thursday, September 28, 2006 6:24 AM

All replies

  • Hi,

    Have you found the solution? I'm having the same trouble but with an XLS source. It works fine in localhost, but not in ISP. I have checked column names too...

    Thank you!!!
    Cheers
    Aureliano

    Thursday, October 12, 2006 1:52 PM
  • The ADO.Net forums may be able to provide answers to your specific question and/or provide some tips on determining the cause of the error.

    http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=45&SiteID=1

    Tuesday, October 17, 2006 5:46 PM
  • I had the same issue, and it had to do with the columnmapping being case sensitive.  For instance I was using :

    SqlBulkCopyColumnMapping sqlMap = new SqlBulkCopyColumnMapping("ivl_desc","item_desc") which gave me the error above.  I then switched to:

    SqlBulkCopyColumnMapping sqlMap = new SqlBulkCopyColumnMapping(dataSet1.Invoice_Line.Columns["ivl_desc"].ColumnName, dataSet1.Invoice_Line_History.Columns["item_desc"].ColumnName);

     

    After that, the bulk insert worked great.

     

    Thursday, May 17, 2007 8:23 PM