62,046
社区成员
发帖
与我相关
我的任务
分享
string fileName = this.FileUpload1.FileName;
string path = Server.MapPath(fileName);
string path = "C:\\Documents and Settings\\lmms\\桌面\\表格模板\\新建 Microsoft Excel 工作表.xls";
string strCon = "Provider = Microsoft.Jet.OLEDB.4.0 ;" +
"Data Source="+path+"; Extended Properties=Excel 8.0 ";
OleDbConnection myConn = new OleDbConnection(strCon);
myConn.Open();
string strCom = " SELECT * FROM [Sheet1$] ";
OleDbCommand myconmm = new OleDbCommand(strCom, myConn);
myconmm.ExecuteNonQuery();