110,536
社区成员
发帖
与我相关
我的任务
分享
private void DataListBind()
{
string strconn = "server=.;database=Mojo_tianzhuju;uid=sa;pwd=p@ssw0rd";
SqlConnection Conn = new SqlConnection(strconn);
Conn.Open();
string sKey = this.Txtproduct.Text;
SqlDataAdapter sda = new SqlDataAdapter();
//调用存储过程
SqlCommand comm = new SqlCommand("EXEC UP_SearchHouseInfo", Conn);
comm.CommandType = CommandType.StoredProcedure;
if (this.RadioButton1.Checked)
rbtleixing = "租房";
else if (this.RadioButton2.Checked)
rbtleixing = "二手房";
else if (this.RadioButton3.Checked)
rbtleixing = "新房";
else if (this.RadioButton4.Checked)
rbtleixing = "商用房";
comm.Parameters.Add(new SqlParameter("@hifangwulx", rbtleixing));
comm.Parameters.Add(new SqlParameter("@hihuxing",this.Shi.SelectedValue+"室"+this.Ting.SelectedValue+"厅"+this.Wei.SelectedValue+"卫"));
comm.Parameters.Add(new SqlParameter("@hifangyuanqy", this.quyu.SelectedValue));
comm.Parameters.Add(new SqlParameter("@hinidingjg", this.shoujia.SelectedValue));
comm.Parameters.Add(new SqlParameter("@SearchKey",sKey));
DataSet ds = new DataSet();
comm.CommandTimeout = 999;
sda.SelectCommand = comm;
DataListHouseInfo.DataSource = ds;
DataListHouseInfo.DataBind();
}
string strconn = "server=.;database=Mojo_tianzhuju;uid=sa;pwd=p@ssw0rd";
SqlConnection Conn = new SqlConnection(strconn);
Conn.Open();
string sKey = this.Txtproduct.Text;
//调用存储过程
SqlDataAdapter sda= new SqlDataAdapter("EXEC UP_SearchHouseInfo", Conn);
comm.CommandType = CommandType.StoredProcedure;
if (this.RadioButton1.Checked)
rbtleixing = "租房";
else if (this.RadioButton2.Checked)
rbtleixing = "二手房";
else if (this.RadioButton3.Checked)
rbtleixing = "新房";
else if (this.RadioButton4.Checked)
rbtleixing = "商用房";
sda.Parameters.Add(new SqlParameter("@hifangwulx", rbtleixing));
sda.Parameters.Add(new SqlParameter("@hihuxing",this.Shi.SelectedValue+"室"+this.Ting.SelectedValue+"厅"+this.Wei.SelectedValue+"卫"));
sda.Parameters.Add(new SqlParameter("@hifangyuanqy", this.quyu.SelectedValue));
sda.Parameters.Add(new SqlParameter("@hinidingjg", this.shoujia.SelectedValue));
sda.Parameters.Add(new SqlParameter("@SearchKey",sKey));
DataSet ds = new DataSet();
comm.CommandTimeout = 999;
sda.Fill(ds);
DataListHouseInfo.DataSource = ds;
DataListHouseInfo.DataBind();