...........
string a = this.Dropdownlist.selectValue;
string b = this.textbox1.text;
string strsql = "";
if( a!= "")
{
strsql = " and 数据库对应字段 = "+a;
}
if( b != "")
{
strsql += " and 数据库对应字段 = "+ b;
}
String Sql = "select * from tableName where 1=1";
Sql + strsql 最后要执行的SQL
传入方法内! 返回数据
绑定就行了!
string a = this.Dropdownlist.selectValue;
string b = this.textbox1.text;
string strsql = "";
if( a!= "")
{
strsql = " and 数据库对应字段 = "+a;
}
if( b != "")
{
strsql += " and 数据库对应字段 = "+ b;
}
String Sql = "select * from tableName where 1=1";
Sql + strsql 最后要执行的SQL
传入方法内! 返回数据
绑定就行了!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货