急救!!!!120
两个占位符在一起做参数@wise这个是排序方式 @mode 这个是在DropDownList选择的数据库字段排序字段出的错 第 1 行: '@wise' 附近有语法错误。
public DataTable Selectbytiaojian( int x_stid,int x_tid, string title,string keyword,int x_sbid,string mode,string wise,string Sqlcon, int PageSize, int CurrentPageIndex)
{
string sql = "select xshop_s.x_yeshu,xshop_s.x_id,xshop_s.x_file, xshop_s.x_sbid,dbo.xshop_b.x_name,dbo.xshop_s.x_name as 'sname',dbo.xshop_s.x_frist,xshop_s.x_important1,xshop_s.x_money,xshop_s.x_time,xshop_s.x_hit,xshop_s.x_size from dbo.xshop_b,xshop_s where xshop_s.x_stid=" + x_stid + " and xshop_s.x_sbid =xshop_b.x_id and xshop_b.x_tid=" + x_tid + " and xshop_s.x_opinion='S' and @title like @keyword and x_sbid=" + x_sbid + " order by @mode @wise+";
SqlParameter[] Parameter = {
new SqlParameter("@title", title),
new SqlParameter("@keyword",keyword),
new SqlParameter("@mode",mode),
new SqlParameter("@wise",wise)
};
return DAL.AspNetPager.Select(Sqlcon, sql, PageSize, CurrentPageIndex, Parameter);
--------------------编程问答-------------------- order by @mode @wise+,最后的“+”什么用处? --------------------编程问答-------------------- order by @mode,@wise
+是不是多出来的? --------------------编程问答-------------------- 多了个+号
补充:.NET技术 , ASP.NET