G
Guest
Hello,
I am looking to open an Excel spreadsheet in ADO.NET using OLEDB's Jet engine. I have a conn string as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\test\test.xls;Extended Properties=Excel 8.0;
I am attempting to put together the SQL to query this spreadsheet. The examples I have found all look like:
Select * From [Sheet1$]
but this explicitly names the worksheet in the spreadsheet. Is there a way to indicate the worksheet by index instead of name? I am attempting to build an automatic parser for an excel spreadsheet and am looking to query the first worksheet but its name could vary from spreadsheet to spreadsheet. How should I do this? If it is not possible to reference the worksheet within the spreadsheet by index in the SQL Select statement, then is there a way to discover the name of the worksheet at run time without starting an instance of Excel? Thanks for your help!
I am looking to open an Excel spreadsheet in ADO.NET using OLEDB's Jet engine. I have a conn string as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\test\test.xls;Extended Properties=Excel 8.0;
I am attempting to put together the SQL to query this spreadsheet. The examples I have found all look like:
Select * From [Sheet1$]
but this explicitly names the worksheet in the spreadsheet. Is there a way to indicate the worksheet by index instead of name? I am attempting to build an automatic parser for an excel spreadsheet and am looking to query the first worksheet but its name could vary from spreadsheet to spreadsheet. How should I do this? If it is not possible to reference the worksheet within the spreadsheet by index in the SQL Select statement, then is there a way to discover the name of the worksheet at run time without starting an instance of Excel? Thanks for your help!