fu_path.SaveAs(Server.MapPath("~/table/" + tablename));//上传文件保存路径
//上传表数据库连接设置
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "Provider = Microsoft.Jet.OleDb.4.0;" + "Extended Properties=Excel 8.0;";
conn.ConnectionString += "Data source = " + Server.MapPath(@"table/" + tablename);
conn.Open();
OleDbDataReader reader;
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
//从上传表查出数据
cmd.CommandText = "SELECT * FROM [Sheet1$]";
reader = cmd.ExecuteReader();