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 12: public class con1
Line 13: {
Line 14:     static string constr = ConfigurationManager.ConnectionStrings["DataConnectionString1"].ConnectionString;
Line 15:     SqlConnection conn = new SqlConnection();
Line 16:     public void openConnection()

Source File: c:\inetpub\vhosts\latestadvertising.com\httpdocs\App_Code\con1.cs    Line: 14

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   con1..cctor() in c:\inetpub\vhosts\latestadvertising.com\httpdocs\App_Code\con1.cs:14

[TypeInitializationException: The type initializer for 'con1' threw an exception.]
   con1..ctor() in c:\inetpub\vhosts\latestadvertising.com\httpdocs\App_Code\con1.cs:15
   Cs_Execute..ctor() in c:\inetpub\vhosts\latestadvertising.com\httpdocs\App_Code\Cs_Execute.cs:14
   Cs_WhatIsTerms..ctor() in c:\inetpub\vhosts\latestadvertising.com\httpdocs\App_Code\Cs_WhatIsTerms.cs:14
   Groommee_AboutUs.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\latestadvertising.com\httpdocs\ContactUs.aspx.cs:18
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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