What is this problem?
-
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 21: static MemberPhotoConfiguration() Line 22: { Line 23: dbConnectionString = ConfigurationManager.ConnectionStrings["MemberPhotoConnection"].ConnectionString; Line 24: dbProviderName = ConfigurationManager.ConnectionStrings["MemberPhotoConnection"].ProviderName; Line 25: productsPerPage = Int32.Parse(ConfigurationManager.AppSettings["ProductsPerPage"]); Source File: c:\Inetpub\wwwroot\MemberPhoto\App_Code\MemberPhotoConfiguration.cs Line: 23 Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] MemberPhotoConfiguration..cctor() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\MemberPhotoConfiguration.cs:23 [TypeInitializationException: The type initializer for 'MemberPhotoConfiguration' threw an exception.] MemberPhotoConfiguration.get_DbProviderName() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\MemberPhotoConfiguration.cs:45 GenericDataAccess.CreateCommand() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\GenericDataAccess.cs:111 CatalogAccess.GetDepartments() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\CatalogAccess.cs:54 DepartmentsList.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\MemberPhoto\UserControls\DepartmentsList.ascx.cs:22 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
-
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 21: static MemberPhotoConfiguration() Line 22: { Line 23: dbConnectionString = ConfigurationManager.ConnectionStrings["MemberPhotoConnection"].ConnectionString; Line 24: dbProviderName = ConfigurationManager.ConnectionStrings["MemberPhotoConnection"].ProviderName; Line 25: productsPerPage = Int32.Parse(ConfigurationManager.AppSettings["ProductsPerPage"]); Source File: c:\Inetpub\wwwroot\MemberPhoto\App_Code\MemberPhotoConfiguration.cs Line: 23 Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] MemberPhotoConfiguration..cctor() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\MemberPhotoConfiguration.cs:23 [TypeInitializationException: The type initializer for 'MemberPhotoConfiguration' threw an exception.] MemberPhotoConfiguration.get_DbProviderName() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\MemberPhotoConfiguration.cs:45 GenericDataAccess.CreateCommand() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\GenericDataAccess.cs:111 CatalogAccess.GetDepartments() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\CatalogAccess.cs:54 DepartmentsList.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\MemberPhoto\UserControls\DepartmentsList.ascx.cs:22 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
wsamuel, Take a read of the guidelines: http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=1278604#xx1278604xx[^] Shouting "Urgent!!Please Help!!" and not making your subject title useful wont get you help. If you read what the error said, you'd know what it means, something on line 23 is null.
Line 23: dbConnectionString = ConfigurationManager.ConnectionStrings["MemberPhotoConnection"].ConnectionString;
So, check you have created dbConnectionString and that "MemberPhotoConnection" is in the webconfig file. Regards, Gareth.
-
wsamuel, Take a read of the guidelines: http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=1278604#xx1278604xx[^] Shouting "Urgent!!Please Help!!" and not making your subject title useful wont get you help. If you read what the error said, you'd know what it means, something on line 23 is null.
Line 23: dbConnectionString = ConfigurationManager.ConnectionStrings["MemberPhotoConnection"].ConnectionString;
So, check you have created dbConnectionString and that "MemberPhotoConnection" is in the webconfig file. Regards, Gareth.