“/”应用程序中的服务器错误。

无法绑定由多个部分组成的标识符 "a.id"。 SELECT TOP 20 *  FROM (select a.*,b.nick_name,b.avatar FROM view_channel_shequ as a inner join dt_users as b on a.user_name=b.user_name where 1=1 and  a.status=0 and (a.title like '%新工艺%' or nick_name like '%新工艺%' or a.user_name like '%新工艺%' or tags like '%新工艺%')) AS T  ORDER BY (select top 1 add_time from dt_article_comment where article_id=a.id and is_lock=0 and channel_id=9 order by add_time desc) desc

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Exception: 无法绑定由多个部分组成的标识符 "a.id"。 SELECT TOP 20 *  FROM (select a.*,b.nick_name,b.avatar FROM view_channel_shequ as a inner join dt_users as b on a.user_name=b.user_name where 1=1 and  a.status=0 and (a.title like '%新工艺%' or nick_name like '%新工艺%' or a.user_name like '%新工艺%' or tags like '%新工艺%')) AS T  ORDER BY (select top 1 add_time from dt_article_comment where article_id=a.id and is_lock=0 and channel_id=9 order by add_time desc) desc

源错误:

执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:


[Exception: 无法绑定由多个部分组成的标识符 "a.id"。 SELECT TOP 20 *  FROM (select a.*,b.nick_name,b.avatar FROM view_channel_shequ as a inner join dt_users as b on a.user_name=b.user_name where 1=1 and  a.status=0 and (a.title like '%新工艺%' or nick_name like '%新工艺%' or a.user_name like '%新工艺%' or tags like '%新工艺%')) AS T  ORDER BY (select top 1 add_time from dt_article_comment where article_id=a.id and is_lock=0 and channel_id=9 order by add_time desc) desc ]
   XCWL.DBUtility.DbHelperSQL.Query(String SQLString) in D:\xcwl_All\xcwl\XCWL.Web\XCWL.DBUtility\DbHelperSQL.cs:552
   XCWL.DAL.article.GetList(String channel_name, Int32 category_id, Int32 pageSize, Int32 pageIndex, String strWhere, String filedOrder, Int32& recordCount, String fields) +585
   XCWL.BLL.article.GetList(String channel_name, Int32 category_id, Int32 pageIndex, String strWhere, String filedOrder, Int32& recordCount, Int32& pageSize) +82
   XCWL.Web.shequ_list.Page_Load(Object sender, EventArgs e) +869
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.3062.0