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

Source File: c:\inetpub\vhosts\chapracollege.co.in\httpdocs\StudentSearch.aspx.cs    Line: 16

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   StudentSearch2nd..ctor() in c:\inetpub\vhosts\chapracollege.co.in\httpdocs\StudentSearch.aspx.cs:16
   ASP.studentsearch_aspx..ctor() in c:\inetpub\vhosts\chapracollege.co.in\tmp\root\bce5d5e5\9f6853a3\App_Web_m4nwq2xk.4.cs:0
   __ASP.FastObjectFactory_app_web_m4nwq2xk.Create_ASP_studentsearch_aspx() in c:\inetpub\vhosts\chapracollege.co.in\tmp\root\bce5d5e5\9f6853a3\App_Web_m4nwq2xk.6.cs:0
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +131
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +43
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +374
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +194
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +127


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