M
morten
String sConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data Source=c:\\test.xls;" +
@"Extended Properties=Excel 8.0;";
OleDbConnection objConn = new OleDbConnection
(sConnectionString);
objConn.Open();
OleDbCommand objCmdSelect =new OleDbCommand("SELECT *
FROM [sheet1$]", objConn);
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();
objAdapter1.SelectCommand = objCmdSelect;
DataSet objDataset1 = new DataSet();
objAdapter1.Fill(objDataset1, "XLData");
objConn.Close();
Jet can't recognize [sheet1$]!!
what's wrong?
@"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data Source=c:\\test.xls;" +
@"Extended Properties=Excel 8.0;";
OleDbConnection objConn = new OleDbConnection
(sConnectionString);
objConn.Open();
OleDbCommand objCmdSelect =new OleDbCommand("SELECT *
FROM [sheet1$]", objConn);
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();
objAdapter1.SelectCommand = objCmdSelect;
DataSet objDataset1 = new DataSet();
objAdapter1.Fill(objDataset1, "XLData");
objConn.Close();
Jet can't recognize [sheet1$]!!
what's wrong?