• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

Object reference not set to an instance of an object.

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
0
Jeremy_Wiley
Asked:
Jeremy_Wiley
4 Solutions
 
WelkinMazeCommented:
Hi,
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.
0
 
barisgomlekCommented:
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.

---OR---

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.
0
 
wnrossCommented:
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")
      custDb.Open()
   End Sub
</Script>

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

Cheers,
-Bill
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Jeremy_WileyAuthor Commented:
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...
Tks
JW
0
 
yokkuiCommented:
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.
0
 
Jeremy_WileyAuthor Commented:
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.

Thanks,
Jeremy
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now