string oleinfo="Provider=Microsoft.Jet.OleDb.4.0; data " oleinfo=oleinfo+"source=D:\\csmsc\\source\\mz.xls;Extended Properties=Excel 2003;";
string strsel="SELECT * FROM [1$]";
OleDbConnection Myconn=new OleDbConnection(oleinfo);
Myconn.Open();
OleDbDataAdapter Mycomm = new OleDbDataAdapter (strsel,Myconn) ;
DataSet ds=new DataSet();
Mycomm.Fill(ds);
Myconn.Close();
dataGrid1.DataMember= "[1$]" ;
dataGrid1.DataSource =ds;
这是我从网站上抄写的一段代码,系统安装的EXCEL2003版,在程序运行过程中,运行到下列语句时
OleDbDataAdapter Mycomm = new OleDbDataAdapter (strsel,Myconn)
系统报错:未处理的“System.Data.OleDb.OleDbException”类型的异常出现在 system.data.dll 中。
请问各位大侠,问题错在哪里,怎么解决?请赐教!!!!!!!!