当前位置: 代码迷 >> C# >> sql语句请问 select count(*) from TB_News where IsDelete=1 and NewsTitle like '%108%'
  详细解决方案

sql语句请问 select count(*) from TB_News where IsDelete=1 and NewsTitle like '%108%'

热度:46   发布时间:2016-05-05 04:34:49.0
sql语句请教 select count(*) from TB_News where IsDelete=1 and NewsTitle like '%108%'
select count(*) from TB_News where IsDelete=1 and NewsTitle like '%108%'

以上代码在sql server 管理器可以执行的通

一下是C#里面的代码执行后没有结果
 int totalCount = (int)SqlHelper.ExecuteScalar("select count(*) from TB_News where IsDelete=1 and NewsTitle like [email protected]%'", new SqlParameter("@Title", title));

数据库中 “108” 这条数据

------解决思路----------------------
"select count(*) from TB_News where IsDelete=1 and NewsTitle like [email protected]%'"
-》
"string.Format(select count(*) from TB_News where IsDelete=1 and NewsTitle like '%{0}%'",title)
  相关解决方案