Server Error in '/' Application.

#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by `order`' at line 1

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: MySql.Data.MySqlClient.MySqlException: #42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by `order`' at line 1

Source Error:


Line 124:            // children
Line 125:            command.CommandText = String.Format("select * from MediaCategory where ParentId = {0}  order by `order`", category.Id);
Line 126:            reader = command.ExecuteReader();
Line 127:            while (reader.Read())
Line 128:            {

Source File: c:\home\daveroberson.org\wwwroot\App_Code\DataAccess.cs    Line: 126

Stack Trace:


[MySqlException: #42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by `order`' at line 1]
   MySql.Data.MySqlClient.PacketReader.CheckForError() +107
   MySql.Data.MySqlClient.NativeDriver.ReadResult(Int64& affectedRows, Int64& lastInsertId) +28
   MySql.Data.MySqlClient.CommandResult.ReadNextResult(Boolean isFirst) +84
   MySql.Data.MySqlClient.CommandResult..ctor(Driver d, Boolean isBinary) +44
   MySql.Data.MySqlClient.NativeDriver.SendQuery(Byte[] bytes, Int32 length, Boolean consume) +128
   MySql.Data.MySqlClient.MySqlCommand.GetNextResultSet(MySqlDataReader reader) +398
   MySql.Data.MySqlClient.MySqlDataReader.NextResult() +527
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +292
   DataAccess.GetCategoryForPublicCategoryPage(Int32 categoryId) in c:\home\daveroberson.org\wwwroot\App_Code\DataAccess.cs:126
   Controls_Category.Page_Load(Object sender, EventArgs e) in c:\home\daveroberson.org\wwwroot\Controls\Category.ascx.cs:74
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062