A
Acephalus
I am currently using this to get data from an .xls
file:string conn =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + file + ";" +
"Extended Properties=Excel 8.0;";
System.Data.OleDb.OleDbDataAdapter adapter =
new System.Data.OleDb.OleDbDataAdapter("SELECT * FROM
[Sheet1$]",conn);
DataSet ds = new DataSet();
adapter.Fill(ds);
The problem is there has to be a sheet in that .xsl file, called
"Sheet1", otherwise the program generates an exception. Is there a
way to access sheets by index rather than name? Or maybe a better way
of getting data from .xsl files overall?
file:string conn =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + file + ";" +
"Extended Properties=Excel 8.0;";
System.Data.OleDb.OleDbDataAdapter adapter =
new System.Data.OleDb.OleDbDataAdapter("SELECT * FROM
[Sheet1$]",conn);
DataSet ds = new DataSet();
adapter.Fill(ds);
The problem is there has to be a sheet in that .xsl file, called
"Sheet1", otherwise the program generates an exception. Is there a
way to access sheets by index rather than name? Or maybe a better way
of getting data from .xsl files overall?