Hi,
how can I read an open Excelsheet into a dataset? Usually Im using this :
I cant use this way because i cant close the file...
Thx
how can I read an open Excelsheet into a dataset? Usually Im using this :
C#:
String sConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data Source=c:\xlfile.xls;Extended Properties=Excel 8.0;";
OleDbConnection objConn = new OleDbConnection(sConnectionString);
objConn.Open();
OleDbCommand objCmdSelect = new OleDbCommand("SELECT * FROM [Sheet1$]", objConn);
OleDbDataAdapter myda = new OleDbDataAdapter();
myda.SelectCommand = objCmdSelect;
myda.Fill(ds);
I cant use this way because i cant close the file...
Thx