String strSql=String.Format("SELECT * FROM yourTable WHERE 1=1 ")
if(abc!="")
{
strSql+=" and 字段名="+abc;或者strSql+=" and 字段名 LIKE '%"+abc+"%'";
}
拼接sql语句
最新推荐文章于 2025-12-15 10:32:05 发布
String strSql=String.Format("SELECT * FROM yourTable WHERE 1=1 ")
if(abc!="")
{
strSql+=" and 字段名="+abc;或者strSql+=" and 字段名 LIKE '%"+abc+"%'";
}
2024
2007

被折叠的 条评论
为什么被折叠?