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 15: public partial class assignment : System.Web.UI.Page
Line 16: {
Line 17:     SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["con1"].ToString());
Line 18: 
Line 19:     protected void Page_Load(object sender, EventArgs e)

Source File: c:\inetpub\vhosts\kvnsihavali.com\httpdocs\assignment.aspx.cs    Line: 17

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   assignment..ctor() in c:\inetpub\vhosts\kvnsihavali.com\httpdocs\assignment.aspx.cs:17
   ASP.assignment_aspx..ctor() in c:\inetpub\vhosts\kvnsihavali.com\tmp\root\7b3a393f\e8083bc4\App_Web_o3hq1i5j.30.cs:0
   __ASP.FastObjectFactory_app_web_o3hq1i5j.Create_ASP_assignment_aspx() in c:\inetpub\vhosts\kvnsihavali.com\tmp\root\7b3a393f\e8083bc4\App_Web_o3hq1i5j.66.cs:0
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +141
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +45
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +417
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +74
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157


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