Home » excel » C#, OLEDB reading a Excel file from a specified row

C#, OLEDB reading a Excel file from a specified row

Posted by: admin April 23, 2020 Leave a comment

Questions:

I need to read a table in an Excel file starting from 10th row (rows before 10th row are having other data and they are not in a correct format and coteins banners, cell splits, ect) using Ado.Net. How can I do that?

How to&Answers:

It’s all here: How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET. The article contains code samples for to VB.NET, but the C# code shouldn’t be too difficult to deduce.

Pay particular attention to the section specifying Table Naming Conventions

Answer:

Thanks all for your help. Specially Simen. I’ve managed to find a solution for my problem with some help from this article: OleDb connection to Excel; how do I select fixed width, unbounded height?