日期:2014-05-20 浏览次数:20783 次
StringBuider sb =new StringBuider(); sb.Append(“select * from tablename A where 1=1”) if(txtbox1.text!="") sb.Append(" and A.col1=txtbox1.text"); if(txtbox2.text!="") sb.Append(" and A.col2=txtbox2.text"); ....... string sql=sb.Tostring(); ....