Server Error in '/' Application.

Connection must be valid and open.

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.InvalidOperationException: Connection must be valid and open.

Source Error:


Line 51: 	Function loadBuilders()
Line 52: 		Dim strSQL as string = "SELECT business_name, email, website, phone, fax, companies.Post_Code, companies.state, companies.town, Address, companies.id, (SELECT GROUP_CONCAT(NAME,'</td><td class=BlueHighlight>' SEPARATOR '</td></tr><tr><td>') FROM veterinarians WHERE company_id = companies.id ORDER BY Rego_Date) as veterinarian_names FROM companies, towns WHERE suspense='False' AND companies.post_code = towns.post_code AND companies.town = towns.Suburb AND towns.council = '" & strCouncil & "' and length(phone) > 7 Group by business_name Order by " & strOrderBy & ";"
Line 53: 		nexus.loadRepeater(rptBuilders, strSQL)
Line 54: 	End Function
Line 55: 	

Source File: C:\websites\veterinaryhospitals.net.au\www\allSuburb.aspx    Line: 53

Stack Trace:


[InvalidOperationException: Connection must be valid and open.]
   MySql.Data.MySqlClient.MySqlCommand.CheckState() +380
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +166
   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
   Nexus.loadRepeater(Object objRepeater, String strSQL) +111
   ASP.allsuburb_aspx.loadBuilders() in C:\websites\veterinaryhospitals.net.au\www\allSuburb.aspx:53
   ASP.allsuburb_aspx.Page_Load(Object sender, EventArgs e) in C:\websites\veterinaryhospitals.net.au\www\allSuburb.aspx:45
   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.8974