Object reference not set to an instance of an object.

Posted on 2006-04-27
Last Modified: 2013-11-26
I am not a developer, but this is what I have on my plate.
This app was written to run on using SQL 2000 and .Net Framework 1.1
I am running it using SQL 2005 (which has to have framework 2.0 installed) but I also have 1.1 installed and have it selected in IIS for this app to use 1.1. I do not believe this is a SQL issue, I figure the code just may have to be spruced up for 05,  but I may be dead wrong.

I navigate to the web apps URL and the app launches and runs fine, lets me login and all, until I try to run a search of the database. The error below is what I get instead of correct output.
Where does the stack trace come from? Is that the app .net or Sql or what?
Can anyone help point us in the right direction or is this way to generic?

Server Error in '/LQ' 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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   LQAS.NET.CustomerSearchGrid.Page_Load(Object sender, EventArgs e)
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750


Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
Question by:Jeremy_Wiley
    LVL 11

    Assisted Solution

    It seems that some object reference is null. You can look through the code and try to find it ot post some parts of the code here.
    LVL 2

    Assisted Solution

    First put a break in your code that runs when you press the search button (or any action that triggers the search).

    The go line by line.


    a better solution to catch the error is to force Visual studio to break into the code when error happens:
    1. In the Debug menu navigate to Exceptions.
    2. Select "Common Language Runtime Exceptions" and Check "Break Into Debugger" in the first group.
    3. Run.

    When an exception is thrown you will see the code that causes the exception. It can be a variable that is not initialized, so initialize it with "new". You can paste the code so we can look at it.
    LVL 7

    Assisted Solution

    Check your "SQL Server Surface Area Configuration" and "SQL Server Configuration Manager",

    In particular, check the latter under Network Configuration and Client configuration to see if "TCP/IP" is enabled

    Then if everything looks good, create a small page as follows:

    <%@ Import Namespace="System.Data.SqlClient" %>
    <Script Runat="Server">
       Sub Page_Load
          Dim custDb As SqlConnection
          custDb = New SqlConnection("Server=localhost;uid=myID;pwd=mypassword;database=customer")
       End Sub

    If you get a blank page: w00t!
    If you get an error page, well...

    LVL 4

    Author Comment

    Thanks for the input so far everyone. It will probably take me a few days to get a hold of code or anything else helpful. I'll let you know as soon as i have somthing to work with. If I can't obtain anything helpful in a reasonable amount of time I'l just close the call and split points...
    LVL 3

    Accepted Solution

    I also used to have a similar problem before. My app which ran on .Net 1.1 couldn't access its database running on SQL Server 2000 after I installed SQL Server 2005. In the end, I just ended restoring Windows to the point just before the installation of SQL Server 2005, then the issue was solved. You may resort on this solution provided there is no any other way.
    LVL 4

    Author Comment

    My hands are tied, and I can't get any more useful information than I have already provided. It's up to the devs now since they won't hand over code. I'll split.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    Write data from SQL to CSV file - position 1 34
    sumHeights2  challenge 7 48
    Problem to skip loop 6 40
    python sqlite question 11 15
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now