In the case where my user uploads an excel file with only one worksheet, I want to intelligently use only that worksheet. However, when I pull the schema for this file I see an unexpected worksheet (circled):
The schema is retrieved via:
OleDBConnection.GetSchema("Tables")
In this case, it looks like the second worksheet is a filter defined by the user to "peg" two columns from scrolling.
Question: Is it safe for me to ignore worksheets开发者_如何学JAVA with "$<filter>" appended? Put another way, if I run through all the worksheets, throwing out the "$<filter>" types, and find that there is only one left, is it a reasonable default to use that worksheet? Does anyone have a reference?
Thanks!
yes, i would have thought so. $ usually means it is refering to named range or macro in that workbook. you might use Regex and capture anything within ' '.
Here is a reference on how to select data from a named range:
http://msdn.microsoft.com/en-us/library/ms971514.aspx
How do u pull the schema for this file? maybe you can filter it so that it only has Worksheets ?
精彩评论