Hugo
Hugo

Reputation: 6464

Is it possible to access Excel file through ADO.NET that does NOT have a Header Row?

I have a formated Excel file, over which I do not have control, and I need to read the information contained in it.

The problem with the file is that the first few rows contain formated information and I can not modify that file nor I can not ask for a format change.

Is it possible then, to read such a file through ADO.Net?

Thanks in advance,

Upvotes: 1

Views: 348

Answers (1)

Steve Wortham
Steve Wortham

Reputation: 22250

I think this article explains how to do this pretty well: http://support.microsoft.com/kb/316934

As for the lack of a header row...

With Excel workbooks, the first row in a range is the header row (or field names) by default. If the first range does not contain headers, you can specify HDR=NO in the extended properties in your connection string. If you specify HDR=NO in the connection string, the Jet OLE DB provider automatically names the fields for you (F1 represents the first field, F2 represents the second field, and so on).

Upvotes: 3

Related Questions