开发者

how to prevent oledb from auto generating column name in excel

I am reading excel file from C# 3.5 using OleDB. I want to read only those columns that have a column heading. When I tried to get all the column names using

GetOleDbSchemaTable(OleDbSchemaGuid.Columns...), it auto generates column name such as F30, F34 etc. Is there a way to prevent this auto generation of column name?

[EDIT] OK, I solved this by a using a work around - used a reg ex to match the pattern F<>:

Regex r = new Regex("^F{1}[0-9]+$");

开发者_StackOverflow社区

Please let me know if any one has a better solution.

Thanks vikram

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜