'/' 應用程式中發生伺服器錯誤。

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND lang=1' at line 1

描述: 在執行目前 Web 要求的過程中發生未處理的例外狀況。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。

例外狀況詳細資訊: MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND lang=1' at line 1

原始程式錯誤:


行 213:                {
行 214:                    mydbCmd2.CommandText = "SELECT groups, ParentID FROM categories WHERE id = " + g_pid + " AND lang=@lang ";
行 215:                    mydbDR2 = mydbCmd2.ExecuteReader();
行 216:                    if (mydbDR2.Read())
行 217:                    {

原始程式檔: d:\www\flipbakery.com.tw\httpdocs\ProdList.aspx.cs    行: 215

堆疊追蹤:


[MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND lang=1' at line 1]
   MySql.Data.MySqlClient.MySqlStream.OpenPacket() +228
   MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId) +62
   MySql.Data.MySqlClient.MySqlDataReader.GetResultSet() +48
   MySql.Data.MySqlClient.MySqlDataReader.NextResult() +516
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +803
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() +6
   ProdList.GetCate(String pid) in d:\www\flipbakery.com.tw\httpdocs\ProdList.aspx.cs:215
   ProdList.Page_Load(Object sender, EventArgs e) in d:\www\flipbakery.com.tw\httpdocs\ProdList.aspx.cs:123
   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


版本資訊: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.8.4494.0