62,195
社区成员
发帖
与我相关
我的任务
分享
Session["fbsj"] = txtfbsj.Text;
Session["zldw"] = txtzldw.Text;
Session["zlr"] = txtzlr.Text;
Session["zlzt"] = ddlzlzt.SelectedValue;
Session["bt"] = txtbt.Text;
Session["fkqx"] = txtfkqx.Text;
Response.Redirect("YanPanSelectResult.aspx");
SqlConnection con = SqlCon.GetSqlConnection();
SqlDataAdapter da = new SqlDataAdapter("select * from jh_zlxx where ((@fbsj is null or zlxx_fbsj=@fbsj) and (@zldw is null or zlxx_zldw=@zldw) and (@zlr is null or zlxx_zlr=@zlr) and (@zlzt is null or zlxx_zlzt=@zlzt))",con);
da.SelectCommand.Parameters.AddWithValue("@fbsj", Session["fbsj"]);
da.SelectCommand.Parameters.AddWithValue("@zldw",Session["zldw"]);
da.SelectCommand.Parameters.AddWithValue("@zlr",Session["zlr"]);
da.SelectCommand.Parameters.AddWithValue("@zlzt",Session["zlzt"]);
DataSet ds = new DataSet();
da.Fill(ds, "SelectResult");
gdvFaBu.DataSource = ds;
gdvFaBu.DataBind();