Server Error in '/RealEstate' Application.

Object reference not set to an instance of an object.

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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 194:            int parseResult;
Line 195:            // Free text has been entered and the text is a number, get the proprty number
Line 196:            if (!string.IsNullOrEmpty(searchFields.FreeText) && Int32.TryParse(searchFields.FreeText, out parseResult))
Line 197:            {
Line 198:                query.Append(" AND search_table.ID = '");

Source File: C:\inetpub\wwwroot\RealEstate\MySqlQueryManager.cs    Line: 196

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   SocietyWebApplication.MySqlQueryManager.BuildSearchQuery(SearchParams searchFields, String modifyString) in C:\inetpub\wwwroot\RealEstate\MySqlQueryManager.cs:196
   SocietyWebApplication.MySqlQueryManager.PerformSearch(String sortExp, String sortOrder, SearchParams searchFields, HttpResponse response) in C:\inetpub\wwwroot\RealEstate\MySqlQueryManager.cs:178
   SocietyWebApplication.Search.PerformSearchAndDisplay(SearchParams searchParams, String action) in C:\inetpub\wwwroot\RealEstate\Search.aspx.cs:218
   SocietyWebApplication.Search.Page_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\RealEstate\Search.aspx.cs:137
   System.Web.UI.Control.OnLoad(EventArgs e) +107
   System.Web.UI.Control.LoadRecursive() +89
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1532


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