Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. What is this problem?

What is this problem?

Scheduled Pinned Locked Moved C#
helpquestiondesigndata-structuresdebugging
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wsamuel
    wrote on last edited by
    #1

    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

    G 1 Reply Last reply
    0
    • W wsamuel

      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

      G Offline
      G Offline
      Gareth H
      wrote on last edited by
      #2

      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.

      W 1 Reply Last reply
      0
      • G Gareth H

        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.

        W Offline
        W Offline
        wsamuel
        wrote on last edited by
        #3

        I'm so sorry. I'm new to here. Thanks for the remind and the help.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups