这样的搜索应该如何在应用程序中处理? 有5个搜索条件,如性别(1),出生年月(2),联系方式(3),工作地点(4),职位(5)那么理论上来说就有5的阶乘个搜索组合,是不是就要写5的阶乘个搜索select语句???那不是太过分了.......... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以这样阿String strSQL = "Select * From Table Where (1=1) ";if(按性别搜) strSQL += "And (Sex = " + sex的值 + ") "; 其它同理 首先判断五个条件是否有值,如果没有值,就使用 like '*'if(strname == ""){ string strname = "like '*'"}else{ string strname = "like 'name%'"}string strSql = "select * from Table where (name" + strname + ") and () and () and () and ()"; LaoDai_Net(老代.Net『学无止境』) 可以 海康 板块 怎么获取原始图像数据流 在winform中什么控件可以实现qq选择'状态栏' 有关DataGridView数据绑定的问题 treeview的问题 求助:数制的转换 如何利用自己架设的邮件服务器发信 C#调试出错,帮忙解决一下 console的输出 使用 C#+ASP.NET+SQLServer 建设的网站 www.xmlchina.net 测试中! 我的背景音乐在哪里呀:)??????????????? 初学者,简单问题,给分,谢谢.第3贴 其实我不想来这儿的!!!
String strSQL = "Select * From Table Where (1=1) ";
if(按性别搜)
strSQL += "And (Sex = " + sex的值 + ") "; 其它同理
if(strname == "")
{
string strname = "like '*'"
}
else
{
string strname = "like 'name%'"}
string strSql = "select * from Table where (name" + strname + ") and () and () and () and ()";