ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.how to SqlBulkCopy using different column between excel and dabase table<p>Hi,</p> <p>You need to map the Column name link below as Given in article</p> <pre class="brush: csharp">sqlBulkCopy.ColumnMappings.Add(&#34;Id&#34;, &#34;PersonId&#34;) sqlBulkCopy.ColumnMappings.Add(&#34;Name&#34;, &#34;Name&#34;) sqlBulkCopy.ColumnMappings.Add(&#34;Salary&#34;, &#34;Salary&#34;)</pre> <p>I hope this will help you out.</p>https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/Wed, 16 Mar 2016 04:25:34 GMThow to SqlBulkCopy using different column between excel and dabase table<p>I did that, but when I debug the code it shows error something like the destination&nbsp;table and source table are not match up.</p> <p>&nbsp;</p> <p>FYI: My excel columns are 3 and my sql table columns are 8(so I think it's because of that)</p>https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/Wed, 16 Mar 2016 06:59:44 GMThow to SqlBulkCopy using different column between excel and dabase table<p>Hi,</p> <p>Make sure that all other column must be nullable for which you are not passing value or they must have default constraint</p> <p>I hope this will help you out.</p> <p>&nbsp;</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/Thu, 17 Mar 2016 04:06:25 GMThow to SqlBulkCopy using different column between excel and dabase table<p>I found the issue, it seems that I misstype the column name.</p> <p>&nbsp;</p> <p>@Shshikant: thanks for your attantion and help :)</p>https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/Thu, 17 Mar 2016 07:22:40 GMThow to SqlBulkCopy using different column between excel and dabase tableInstead of saying thanks mark the reply or replies(if multiple) that helped as Answer.https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/https://www.aspforums.net:443/Threads/134246/how-to-SqlBulkCopy-using-different-column-between-excel-and-dabase-table/Thu, 17 Mar 2016 07:33:08 GMT