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 8:  public partial class application : System.Web.UI.Page
Line 9:  {
Line 10:     static String strConnString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
Line 11:     SqlConnection con = new SqlConnection(strConnString);
Line 12:     auto_increment obj = new auto_increment();

Source File: g:\pleskvhosts\svsems.in\httpdocs\PMCPE\application.aspx.cs    Line: 10

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   application..cctor() in g:\pleskvhosts\svsems.in\httpdocs\PMCPE\application.aspx.cs:10

[TypeInitializationException: The type initializer for 'application' threw an exception.]
   application..ctor() in g:\pleskvhosts\svsems.in\httpdocs\PMCPE\application.aspx.cs:14
   ASP.application_aspx..ctor() in App_Web_mgy2ovtg.4.cs:0
   __ASP.FastObjectFactory_app_web_mgy2ovtg.Create_ASP_application_aspx() in App_Web_mgy2ovtg.6.cs:0
   System.Web.Compilation.BuildResultCompiledType.CreateInstance() +31
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +104
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33
   System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +39
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +386
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +163


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