if (File.Exists(Server.MapPath("/tempmdb/" + filename))) { //查询,如果此表存在,就表示已经添加过了, 不允许再添加 if (db.counts("select count(id) from sysobjects where name='" + tablename + "'") > 0) { cm.msg("今天的数据表已经存在,您可能已经导入过了.请检查!!"); Response.End(); } DateTime d = DateTime.Now;
//读取源文件
db.ExeSql("select * into [" + tablename + "] from PosSrcTable"); //读数据,写SQL OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=" + Server.MapPath("/tempmdb/" + filename) + ";");
DataTable dts = new DataTable(); OleDbDataAdapter da = new OleDbDataAdapter("select sss_date,custom_no,txn_type from ls", conn); da.Fill(dts); string connstr = "server=(local);database=fasfdas;uid=sa;pwd=adfdasmin";