| 发表于:2007-02-28 11:22:006楼 得分:0 |
string sql= "select * from tb_a where 1=1 " if(dropdownlist.selectedvalue.lenth> 0) { sql+= " and column1= ' "+dropdownlist.selectedvalue+ " ' "; } if(textbox1.text.trim().length> 0) { sql+= " and column2 like '% "+textbox1.text+ "% ' "; } sql+= " order by id desc " | | |
|