Hello All,
I am doing POC where .xls data insert into SQL Server DB.
But behavior of the excel its taking records getting inserted from third rows.
Example excel file contails header as columns first row and second row starts records but insertion start from third rows its ignores the first record.
Please help me on this issue to resolve.

Vishal JoshiPosted Jan 16, 2023, 6:09 AM
Hello
You should check Connection String for Excel 2003 and Excel 2007 or higher formats.
Set OLEDB Driver accordingly and try to import data.
Check the below article to import data from excel to SQL using c# using SqlBulkCopy.
https://www.aspsnippets.com/Articles/Import-Excel-data-to-SQL-Server-Database-in-ASPNet-using-C-and-VBNet.aspx
Thank you
Aravind GovindarajPosted Jan 13, 2023, 4:10 PM
May be considering the Second row also as a header. Can you create a new xls file with only two columns with a header and check if are you facing the same issue?
Sachin SinghPosted Jan 13, 2023, 3:47 PM
what method have you used, with sqlbulkcopy you can do it like this