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

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

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

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

源错误:


行 24:         Model.ProductDetail Articlemodel = new Model.ProductDetail();
行 25:         Articlemodel.Hits = ProductDetailModel.Hits + 1;
行 26:         new BLL.ProductDetail().Update(Articlemodel, "ID=" + ProductDetailModel.ID);
行 27:         ProductModel = new BLL.Product().GetModelBystrWhere("(select top 1 Picsmall from TB_Image where charindex(','+convert(varchar,ID)+',',','+TB_Product.Picsmall+',')>0) as Picsmall,*",
行 28:             "IsPass=1 and ID=" + (string.IsNullOrWhiteSpace(ProductDetailModel.ProID) ? "0" : ProductDetailModel.ProID.Split(',')[0])) ?? new Model.Product();

源文件: c:\web\Web_New\Web\product\details.aspx.cs    行: 26

堆栈跟踪:


[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.ProductDetail.Update(ProductDetail model, String strWhere) in C:\Users\Administrator\Desktop\20161102\BLL\ProductDetail.cs:85
   product_details.Page_Load(Object sender, EventArgs e) in c:\web\Web_New\Web\product\details.aspx.cs:26
   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