Server Error in '/' Application.

Incorrect syntax near the keyword 'on'.

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.Data.OleDb.OleDbException: Incorrect syntax near the keyword 'on'.

Source Error:


Line 464:	 
Line 465:                    myAdapter.SelectCommand.CommandText = "SELECT TOP 1 ParentID from tblDropMenu WHERE Link='" + "/" + sThisLink + "' Or PageName='" + sThisLink.Replace("%20", " ") + "' Or PageName='" + sThisLink.Replace(" ", "%20") + "'"
Line 466:                    myAdapter.Fill(rsTrace)
Line 467:	
Line 468:                    Dim iPrnId As Integer = 0

Source File: C:\inetpub\wwwus14\Avgas\menu\template.aspx    Line: 466

Stack Trace:


[OleDbException (0x80040e14): Incorrect syntax near the keyword 'on'.]
   System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) +1887157
   System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +319
   System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +247
   System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +175
   System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +144
   System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +9
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +221
   System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +579
   System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +181
   ASP.website_master.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in C:\inetpub\wwwus14\Avgas\menu\template.aspx:466
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +115
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +253
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +87
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240
   System.Web.UI.Page.Render(HtmlTextWriter writer) +38
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4240


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