首页 新闻 赞助 找找看

关于hubbledotnet,拼接连接搜索与使用参数搜索结果不同.

0
[已关闭问题] 关闭于 2013-11-01 10:23

直接用语句查询:

select top 500 * from searchIndex
where (title contains '更新^5^0' or Contents contains '更新^5^0' or 
Description contains '更新^5^0' or KeyWords contains '更新^5^0' or
Tags contains '更新^5^0') and CustomerID=19
and publishDate>'2013/10/10 0:00:00' and publishDate<'2013/10/17 23:59:59' order by publishdate desc

 

用参数查询:

select top 500 id from searchIndex
where (title contains @MatchString or Contents contains @MatchString or 
Description contains @MatchString or KeyWords contains @MatchString or
Tags contains @MatchString) and CustomerID
=@Cid
and publishDate>@StartDate and publishDate<@EndDate order by publishdate desc adapter.SelectCommand.Parameters.Add("@MatchString","更新^5^0"); adapter.SelectCommand.Parameters.Add("@Cid", "19"); adapter.SelectCommand.Parameters.Add("@StartDate", "2013/10/10 0:00:00"); adapter.SelectCommand.Parameters.Add("@EndDate", "2013/10/17 23:59:59");
两个方式得到的结果数据却有相同,不知道是不是拼写查询串,和用参数查询有什么不一样么.?
只会造轮子的主页 只会造轮子 | 老鸟四级 | 园豆:2274
提问于:2013-10-17 14:16
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册