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. Web Development
  3. ASP.NET
  4. Object reference not set to an instance of an object

Object reference not set to an instance of an object

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netvisual-studiosysadminhelp
5 Posts 4 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.
  • S Offline
    S Offline
    Samiullah
    wrote on last edited by
    #1

    Hi, As i have downloaded a small asp.net ajax project and i added this project to my visual studio 2005 and when i execute the project the error message "object reference not set to an instance of an object". and also i modified the connection string. The ASPNET.MDF file in server explorer is having the cross mark. can anyone provide solution for this. Thank in advance..

    B S S 3 Replies Last reply
    0
    • S Samiullah

      Hi, As i have downloaded a small asp.net ajax project and i added this project to my visual studio 2005 and when i execute the project the error message "object reference not set to an instance of an object". and also i modified the connection string. The ASPNET.MDF file in server explorer is having the cross mark. can anyone provide solution for this. Thank in advance..

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      Debug the code.And check the line of code from that you are getting this error and it would be helpful if you put your piece of code here.

      Cheers!! Brij

      1 Reply Last reply
      0
      • S Samiullah

        Hi, As i have downloaded a small asp.net ajax project and i added this project to my visual studio 2005 and when i execute the project the error message "object reference not set to an instance of an object". and also i modified the connection string. The ASPNET.MDF file in server explorer is having the cross mark. can anyone provide solution for this. Thank in advance..

        S Offline
        S Offline
        SeMartens
        wrote on last edited by
        #3

        Hi Samiullah, this has nothing to do with the connection string. The program is missing an object, where an object is expected it is null. Check the exception details for the line in the code where the exception is thrown. This will give you a hint which object is missing. Regards Sebastian

        It's not a bug, it's a feature! Me in Softwareland.

        1 Reply Last reply
        0
        • S Samiullah

          Hi, As i have downloaded a small asp.net ajax project and i added this project to my visual studio 2005 and when i execute the project the error message "object reference not set to an instance of an object". and also i modified the connection string. The ASPNET.MDF file in server explorer is having the cross mark. can anyone provide solution for this. Thank in advance..

          S Offline
          S Offline
          Samiullah
          wrote on last edited by
          #4

          The error as follow... 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 720: private void InitConnection() { Line 721: this._connection = new global::System.Data.SqlClient.SqlConnection(); Line 722: this._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["AdventureWorksConnectionString"].ConnectionString; Line 723: } Line 724: Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\products\7bb3ee42\1a34f12b\App_Code.3orrxfoa.2.cs Line: 722

          S 1 Reply Last reply
          0
          • S Samiullah

            The error as follow... 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 720: private void InitConnection() { Line 721: this._connection = new global::System.Data.SqlClient.SqlConnection(); Line 722: this._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["AdventureWorksConnectionString"].ConnectionString; Line 723: } Line 724: Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\products\7bb3ee42\1a34f12b\App_Code.3orrxfoa.2.cs Line: 722

            S Offline
            S Offline
            sudhanvag
            wrote on last edited by
            #5

            Check the connection string. Enter valid credentials, and database name. Cheers, Sudhanva

            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