Server Error in '/' 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 34: 
Line 35:             // Add a page hit record, lookup in the menu what the MENU Name is
Line 36:             SqlConnection myConnection = new SqlConnection(WebConfigurationManager.ConnectionStrings["legacymbgpw"].ConnectionString);
Line 37:             SqlCommand myCommand = new SqlCommand("SELECT Menu_Display from Site_Menu WITH (NOLOCK) where SEO_URL='" + s + "'", myConnection);
Line 38:             SqlDataReader reader = null;

Source File: c:\Shared\Deploy_1943gpw\napapartlist.aspx.cs    Line: 36

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   napapartlist.Page_Load(Object sender, EventArgs e) in c:\Shared\Deploy_1943gpw\napapartlist.aspx.cs:36
   System.Web.UI.Control.OnLoad(EventArgs e) +105
   System.Web.UI.Control.LoadRecursive() +67
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3784


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