直接用语句查询:
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");