vs.net 2010 : 以特定条件查询数据库,其中textbox两个,dropdownlist一个,想在dropdownlist显示全部选项
语句如下:stringqueryString="SELECT*FROMBXPBWHERE1=1";if(StuSY.Text.Trim()!=string.Empty)q...
语句如下:
string queryString = "SELECT * FROM BXPB WHERE 1=1";
if (StuSY.Text.Trim() != string.Empty)
queryString += "and SYRY like '%" + StuSY.Text.Trim() + "%'";
if (StuBH.Text.Trim() != string.Empty)
queryString += "and BH like '%" + StuBH.Text.Trim() + "%'";
if (StuCD.Text != "全部")
queryString += "and CD like '%" + StuCD.SelectedValue + "%'";
return queryString;
dropdownlist 只显示数据库列CD里面的选项,不显示全部
求解???? 展开
string queryString = "SELECT * FROM BXPB WHERE 1=1";
if (StuSY.Text.Trim() != string.Empty)
queryString += "and SYRY like '%" + StuSY.Text.Trim() + "%'";
if (StuBH.Text.Trim() != string.Empty)
queryString += "and BH like '%" + StuBH.Text.Trim() + "%'";
if (StuCD.Text != "全部")
queryString += "and CD like '%" + StuCD.SelectedValue + "%'";
return queryString;
dropdownlist 只显示数据库列CD里面的选项,不显示全部
求解???? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询