多条件不定查询转换为存贮过程怎么弄啊
大哥们能帮个忙吗 /////////////////////////////////////分割线//////////////////////////////
string strConn = " server=" + passname.dataip + "; database=MYERP;uid='sa';pwd='sa'";
SqlConnection conn = new SqlConnection(strConn);
conn.Open();
string sqlsel = "select * from sickinfo where 0=0";
////////*************条件判断*********
if (iskeyword.Text != "")
{
sqlsel += " and askedinfo like '" + "%" + "" + iskeyword.Text.Trim() + "" + "%" + "' ";
}
if (iskf.Text != "")
{
sqlsel += "and kefu='" + iskf.Text.Trim() + "'";
}
if (isdy.Text != "")
{
sqlsel += "and admit='" + isdy.Text.Trim() + "' or kefu='" + isdy.Text.Trim() + "' ";
}
if (iszj.Text != "")
{
sqlsel += "and zhuanjia='" + iszj.Text.Trim() + "'";
}
if (comboBox1.Text != "" && comboBox2.Text != "")
{
sqlsel += "and addtime between '" + comboBox1.Text.Trim() + "' and '" + comboBox2.Text.Trim() + "'";
}
if (iszt.Text != "")
{
sqlsel += "and state ='" + iszt.Text.Trim() + "'";
}
if (islx.Text != "")
{
sqlsel += "and istype='" + islx.Text.Trim() + "'";
}
if (isly.Text != "")
{
sqlsel += "and infofrom ='" + isly.Text.Trim() + "'";
}
SqlDataAdapter sda = new SqlDataAdapter(sqlsel, conn);
sda.Fill(ds, "ds");
conn.Close();
///////////////////////////////////////////////////到此//////////////////////
这个搜索怎么改成 存储过程啊