当前位置: 代码迷 >> ASP.NET >> 帮小弟我看一下这个SQL语句错在哪里 string strSql= "select * from aa where FuName like '% @FuName %' order by id desc"
  详细解决方案

帮小弟我看一下这个SQL语句错在哪里 string strSql= "select * from aa where FuName like '% @FuName %' order by id desc"

热度:3951   发布时间:2013-02-25 00:00:00.0
帮我看一下这个SQL语句错在哪里 string strSql= "select * from aa where FuName like '% @FuName %' order by id desc";
帮我看一下这个SQL语句错在哪里   string   strSql=   "select   *   from   aa   where   FuName   like   '%   @FuName   % '   order   by   id   desc ";

帮我改一下吧

------解决方案--------------------------------------------------------
@
------解决方案--------------------------------------------------------
'% '+@FuName + '% '
------解决方案--------------------------------------------------------
string strSql= "select * from aa where FuName like '% "+@FuName+ " % ' order by id desc ";

------解决方案--------------------------------------------------------
'% ”+@FuName +“% '
------解决方案--------------------------------------------------------
string strSql= "select * from aa where FuName like '% '+@FuName+ '% ' order by id desc ";


------解决方案--------------------------------------------------------
打开SQL 查询分析器,把你的这段sql语句copy上去,编译,自己找错(备注:变量的地方,自己随意写个测试值,引号去掉,只要编译没错就行了)
  相关解决方案