Server Error in '/' Application.

Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'zbynet_cestwin.recommend.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

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: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'zbynet_cestwin.recommend.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Source Error:


Line 1336:        SelectQry += " ORDER BY RAND() desc limit 2"
Line 1337:        Dim SampleDataAdapter As New MySqlDataAdapter(SelectQry, connectionString)
Line 1338:        SampleDataAdapter.Fill(SampleSource, "WEB_LINKS")
Line 1339:        'Next
Line 1340:        'End If

Source File: C:\Inetpub\vhosts\zbynet.com\httpdocs\morecat.aspx.vb    Line: 1338

Stack Trace:


[MySqlException (0x80004005): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'zbynet_cestwin.recommend.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by]
   MySql.Data.MySqlClient.MySqlStream.OpenPacket() +280
   MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId) +59
   MySql.Data.MySqlClient.MySqlDataReader.GetResultSet() +62
   MySql.Data.MySqlClient.MySqlDataReader.NextResult() +1008
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1658
   MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +9
   System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +19
   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(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +573
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +161
   morecat.GetData2(String Expression) in C:\Inetpub\vhosts\zbynet.com\httpdocs\morecat.aspx.vb:1338
   morecat.BindListView() in C:\Inetpub\vhosts\zbynet.com\httpdocs\morecat.aspx.vb:1306
   morecat.Page_Load(Object sender, EventArgs e) in C:\Inetpub\vhosts\zbynet.com\httpdocs\morecat.aspx.vb:162
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8975