Server Error in '/' Application.

Syntax error (missing operator) in query expression 'flag = and id<121'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Syntax error (missing operator) in query expression 'flag = and id<121'.

Source Error:


Line 64:             sTxt.Text = "<p></p><p align=center>文章不存在或已被删除!</p>";
Line 65:         DBClass.WebSet(stt, skey, sdec);
Line 66:         dt = db.GetDataTable("select top 1 id,title from news where flag =" + classid + " and id<" + idd + " order by id desc");
Line 67:         if (dt.Rows.Count > 0)
Line 68:             spp1 = "<a href='?id=" + dt.Rows[0][0].ToString() + "'>" + dt.Rows[0][1].ToString() + "</a>";

Source File: c:\webhosting\data\show.aspx    Line: 66

Stack Trace:


[Exception: Syntax error (missing operator) in query expression 'flag = and id<121'.]
   DBClass.GetDataTable(String sqlstr) in F:\WEB\2014\k开普123456\DBClass\DBClass.cs:119
   ASP.show_aspx.Page_Load(Object sender, EventArgs e) in c:\webhosting\data\show.aspx:66
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4330.0