Server Error in '/' Application.

Incorrect syntax near '='.

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 '='.

Source Error:


Line 521:            sQry = "SELECT [TOWN_Designation],[TOWN_URL],[TOWN_ID],[EVT_Event],[EVT_ID],[EVT_Date_Start],[EVT_Date_End],[EVT_Time_Start],[EVT_Time_End],[EVT_Date_Entered] FROM View_WP_Event_Diary_Latest where TOWN_ID = " & gTownID
Line 522:            Dim cmd As New OleDbCommand(sQry, conn)
Line 523:            Dim rdr As OleDbDataReader = cmd.ExecuteReader()
Line 524:            If rdr.HasRows Then
Line 525:                While (rdr.Read())

Source File: \\73031a5ba7.storage-1b.hosting.stackcp.net\sites\1b\7\73031a5ba7\public_html\fs_VillageHall.aspx.vb    Line: 523

Stack Trace:


[OleDbException (0x80040e14): Incorrect syntax near '='.]
   System.Data.OleDb.OleDbDataReader.ProcessResults(OleDbHResult hr) +1247606
   System.Data.OleDb.OleDbDataReader.NextResult() +433
   System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +241
   System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +115
   System.Data.OleDb.OleDbCommand.ExecuteReader() +12
   fs_VillageHall.GetEventsDiary() in \\73031a5ba7.storage-1b.hosting.stackcp.net\sites\1b\7\73031a5ba7\public_html\fs_VillageHall.aspx.vb:523
   fs_VillageHall.Page_Load(Object sender, EventArgs e) in \\73031a5ba7.storage-1b.hosting.stackcp.net\sites\1b\7\73031a5ba7\public_html\fs_VillageHall.aspx.vb:188
   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.4676.0