--改为:
string strSqlNewsContent = "select ProductID,ProductContent from (select ProductID,ProductTitle as ProductContent from ViewProducts union select ProductID,ProductTitle from ViewProductZ union select ProductID,ProductTitle from ViewProductH) a where ProductContent like '%"+SearchKey+"%'";
string strSqlNewsContent = "select ProductID,ProductContent from (select ProductID,ProductTitle as ProductContent from ViewProducts union select ProductID,ProductTitle from ViewProductZ union select ProductID,ProductTitle from ViewProductH) a where ProductContent like '%"+SearchKey+"%'";
因为我要把各种新闻的标题列出来,所以前台帮定的“ProductTitle”字段是不能换的。
但还是要谢谢WangZWang(先来)
string strSqlNewsContent = "select ProductID,ProductContent from (select ProductID,ProductTitle as ProductContent from ViewProducts union select ProductID,ProductTitle from ViewProductZ union select ProductID,ProductTitle from ViewProductH) a where ProductContent like '%"+SearchKey+"%'";
按ProductContent来查询,但这个语句是按ProductTitle查询的。