string strsql="select *from wf_tb_template_file where 1=1";if (datefrom.Length != 0 || dateto.Length != 0)
{
strsql=strsql+" and operatedate between '" + datefrom + "' and '" + dateto + "'";
}
if (search.Length != 0)
{
strsql = strsql + " and name like '%" + search.Trim() + "%'";
}
在执行这个SQL语句 进行搜索的时候为什么会爆出 调用目标发生异常的错误
{
strsql=strsql+" and operatedate between '" + datefrom + "' and '" + dateto + "'";
}
if (search.Length != 0)
{
strsql = strsql + " and name like '%" + search.Trim() + "%'";
}
在执行这个SQL语句 进行搜索的时候为什么会爆出 调用目标发生异常的错误
改成
select * from wf_tb_template_file where 1=1
if (datefrom.Length != 0 && dateto.Length != 0) // 不是 ||吧