哎 没招! 求点思路
解决方案 »
- 在本机用iis搭建个网站出现个奇怪错误
- 大家帮忙看下问题把?快死人啦
- 问个问题,外面不方便,里面请!
- 用treewiew + textbox 做一个控件
- [高分]怎么样把要打印的代码倒出到execl中打印?
- 访问量大出现数据读取错误问题目
- 困扰我的问题,2天了,第二个正常 第一个就不正常
- 这个存储过程如何调用啊?急啊
- 对于小孔子文章系统namespace的不解~忘高人回答一下。
- 如何通过代码设置DataGrid的指定单元格的前景色和背景色?
- Entity framework(EF) Code First这用用法什么优点?实现IRepository接口?究竟有什么优点?
- .Net EasyUI 中使用不了dome的例子是什么原因呀?
select * from t_table where id = @id
and name = @name
and age > @age
and.....
http://www.cnblogs.com/insus/articles/1999795.html
OQLCompare cmpresult=cmp.Compare(entity1.Field1,">=","aaa")
& cmp.Compare(entity1.Field2,"=",123)
& ....无限组合下去var list=EntityQuery<Model1>.QueryList(OQL.From(entity).Select().Where(cmpresult).End);
最好用stringbuilder
query += " and column='" + xxx+ "'";以此类推+= 换成StringBuilder
也可以去遍历你的条件 拼接出一个where条件 接到你sql上。在没找到更好的方案之前 这个可以满足你的需求 就是太挫了。
begin
declare @strWhere varchar(4000)
set @strWhere='select a.*,b.* from texhibinfo as a left join EI_CheckProcess as b on a.Step=b.Step where Is_del=0'
if(@Name_exhibition<>'')--展会名称
set @strWhere = @strWhere+' and Name_exhibition like ''%'+@Name_exhibition+'%'''
if(@productno<>'')--展会类别
set @strWhere = @strWhere+' and productno like ''%'+@productno+'%'''
set @strWhere=@strWhere+' order by No_exhibition desc '
exec(@strWhere)
print(@strWhere)
end
楼主参考一下