小弟在做查询器的时候用到 string str = "select *from Info where 1=1 ";//1=1为永真来实现拼接查询条件拼接。 但我想实现拼接后按时间排序即 string str = "select *from Info where 1=1 order by Published Desc";//1=1为永真 却出现问题了,下面是错误提示 语法错误 (操作符丢失) 在查询表达式 'Publishedand Ttype like '%%' or Bname like '%%' or Area like '%%' or address like '%%' or Fee like '%%' or Houspro like '%%' or Tnature like '%%' or Unit like '%%' or Comyears like '%%' or Payments like '%%' or Traffic like '%%'' 中。
请教各位高手改如何解决,O(∩_∩)O谢谢..米见过这种错 string str = @"select * from Info where 1=1 order by Published Desc"; *后面应该有个空格; where 条件后只能是:column相关的条件 ; 和这样没有区别啊: string str = @"select * from Info order by Published Desc";