Server Error in '/' Application.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' 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: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Source Error:


Line 229:            Using cmd = New MySqlCommand("SELECT a.Immobile, a.MTQ, a.NumBagni, a.Comune, a.NumLetti, g.Provincia, a.Identif, a.Azienda, a.TContratto, (SELECT b.FotoSmall FROM immagini b  WHERE b.Immobile=a.Immobile AND b.Azienda=a.Azienda LIMIT 1) AS immagine, IF(TContratto=1,'vendita','affitto') AS Contratto, g.comune AS ComuneDesc, (SELECT DescrIT FROM tipol_categorie k  WHERE  k.Codice=a.Categoria LIMIT 1) AS CategoriaImm, IF(a.Latitudine IS NULL, g.Latitudine, a.Latitudine) AS Latitudine, IF(a.Longitudine IS NULL, g.Longitudine, a.Longitudine) AS Longitudine FROM immobili a INNER JOIN " & ASP.global_asax.shadminDbName & ".comuni g ON g.IDComune = a.Comune WHERE ((a.Latitudine IS NOT NULL AND a.Longitudine IS NOT NULL) OR (g.Latitudine IS NOT NULL AND g.Longitudine IS NOT NULL )) AND " & filtroMappa, conn)
Line 230:                cmd.Parameters.Clear()
Line 231:                Using dr = cmd.ExecuteReader()
Line 232:                    If dr.HasRows = True Then
Line 233:                        While dr.Read

Source File: D:\home\h645994.winp046.arubabusiness.it\cercaimmobili.net\Catalogo.aspx.vb    Line: 231

Stack Trace:


[MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
   MySql.Data.MySqlClient.MySqlStream.ReadPacket() +270
   MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) +68
   MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) +17
   MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +100
   MySql.Data.MySqlClient.MySqlDataReader.NextResult() +761
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1347
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() +6
   _Catalogo._Catalogo_LoadComplete(Object sender, EventArgs e) in D:\home\h645994.winp046.arubabusiness.it\cercaimmobili.net\Catalogo.aspx.vb:231
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnLoadComplete(EventArgs e) +109
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3665


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