日期:2014-05-17 浏览次数:20495 次
//上传文件
FileUpload1.PostedFile.SaveAs(Server.MapPath("../../Project/files/" + filename));
DataSet ds = DataBaseAccess.ExecuteSql4Ds("select * from OPENROWSET('MICROSOFT.ACE.OLEDB.12.0','Excel 8.0;HDR=YES;DATABASE=" + Server.MapPath("../../Project/files/" + filename) + ";IMEX=1;',[材料导入$])");
DataView dvdetail = ds.Tables[0].DefaultView;
GridView1.DataSource = dvdetail;
GridView1.DataBind();