日期:2014-05-18 浏览次数:21001 次
if (FileUpload1.HasFile) { FileUpload1.PostedFile.SaveAs(Server.MapPath("~/temp/Bugdet_Packing_List.csv")); string str_Conn = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties='text;HDR=YES;FMT=TabDelimited'", Server.MapPath("~/temp/Bugdet_Packing_List.csv")); string cmdText = "SELECT * FROM Bugdet_Packing_List.csv"; System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter(cmdText, str_Conn); DataTable dt_Bugdet_Packing_List = new DataTable(); adapter.Fill(dt_Bugdet_Packing_List); gv_Update_Budget_Packing_List.DataSource = dt_Bugdet_Packing_List; }