开发者

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

开发者 https://www.devze.com 2022-12-10 06:55 出处:网络
I have a formated Excel file, over which I do not have control, and I need to rea开发者_如何转开发d the information contained in it.

I have a formated Excel file, over which I do not have control, and I need to rea开发者_如何转开发d 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,


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

0

精彩评论

暂无评论...
验证码 换一张
取 消