Server Error in '/' Application.

ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ID ='.

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.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ID ='.

Source Error:


Line 109:		sql = "SELECT Nome,ID_macrocategoria FROM messaggio WHERE ID = " + current_idcateg;
Line 110:		command = new OdbcCommand(sql, con);
Line 111:		using (OdbcDataReader reader = command.ExecuteReader())
Line 112:		{
Line 113:			while (reader.Read())

Source File: d:\inetpub\webs\centroceramichecanaleit\prodotti_dettaglio.aspx.cs    Line: 111

Stack Trace:


[OdbcException (0x80131937): ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ID ='.]
   System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) +27
   System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod) +1023
   System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) +59
   System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior) +72
   System.Data.Odbc.OdbcCommand.ExecuteReader() +6
   index.Page_Load(Object sender, EventArgs e) in d:\inetpub\webs\centroceramichecanaleit\prodotti_dettaglio.aspx.cs:111
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +85
   System.Web.UI.Control.OnLoad(EventArgs e) +79
   System.Web.UI.Control.LoadRecursive() +130
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2848


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