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

关键字 'WHERE' 附近有语法错误。

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

异常详细信息: System.Data.SqlClient.SqlException: 关键字 'WHERE' 附近有语法错误。

源错误:


行 33:             Model.Promotion Articlemodel = new Model.Promotion();
行 34:             Articlemodel.Hits = PromotionModel.Hits + 1;
行 35:             new BLL.Promotion().Update(Articlemodel, "ID=" + PromotionModel.ID);
行 36:             Model.PageData<Model.ProductDetail> data = new BLL.ProductDetail().GetList(10, 1, "IsPass=1 and ID in (select DetID from TB_RelationProduct where Belong=3 and TypeID=" + PromotionModel.ID + ")", "AddTime desc");
行 37:             listpd = data.DataSoure;

源文件: c:\web\Web_New\Web\marketActive\productDetails.aspx.cs    行: 35

堆栈跟踪:


[SqlException (0x80131904): 关键字 'WHERE' 附近有语法错误。]
   Maticsoft.DBUtility.DbHelperSQL.ExecuteSql(String SQLString, SqlParameter[] cmdParms) in D:\项目\20161102\DBUtility\DbHelperSQL.cs:568
   Maticsoft.DBUtility.DALHandlerBase`1.Update(T model, String strWhere) in D:\项目\20161102\DBUtility\DALHandlerBase.cs:176
   BLL.Promotion.Update(Promotion model, String strWhere) in C:\Users\Administrator\Desktop\20161102\BLL\Promotion.cs:85
   marketActive_productDetails.Databind() in c:\web\Web_New\Web\marketActive\productDetails.aspx.cs:35
   marketActive_productDetails.Page_Load(Object sender, EventArgs e) in c:\web\Web_New\Web\marketActive\productDetails.aspx.cs:20
   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.6.1590.0