tags:

views:

56

answers:

1

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,

+3  A: 

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).

Steve Wortham
Thank you Steve! That was exactly what I was looking for. =)
Hugo