Read Excel file from a starting row using OLEDB Data Provider in C# .Net

627 Views Asked by At

I have an excel sheet with dynamicnumber of columns. I want to read the excel skipping first 2 rows. So starting from rownumber 3 all columns from the excel using OLEDB Data Provider in C# .Net.

Thanks in advance.

1

There are 1 best solutions below

0
sametcekin On

If you can change excel file like adding column that is an Id. After you can insert data autoincreasing number.

Column ID screenshot

After you can write an SQL script like 'SELECT * FROM [YourSheet$] WHERE Id>2'.(Id is first row so rowNumber>3 is equals to Id>2)