3条回答 默认 最新
- scroch 2019-02-11 12:29关注
stringbuilder sb = new stringbuilder();
sb.append(" where 1=1 ");
if(comboBox1.Text..ToString()!=""){
sb.append(" and stype like '"+comboBox1.Text..ToString()+"' ");
}
if(comboBox2.Text..ToString()!=""){
sb.append(" and region like '"+comboBox2.Text..ToString()+"' ");
}
string sql = sb.ToString();本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报