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)