Object reference not set to an instance of an object

M

Maddy

Hello Everyone,
I am working as a coop student and do not have much experience with
programming YET.
The last student built an application called ICE ACCRETION using Micr
Visual C# 2005.
To explain briefly, the program calculates the amount of ice that ice
formed on wires during icestorms using data from climate canada.

The program was working fine until last week. But once I downloaded a
set of completely new files for a different location it gave me the
following error.
I checked almost whatever I could but am unable to figure out the
issue.
The program uses 11 excel files which have simple data in them.

Any possible suggestion/comments will be appreciated.
Thanks

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance
of an object.
at IceAccretion.Input.NextButton_Click(Object sender, EventArgs e)
in C:\Documents and Settings\Administrator\My Documents\Mike\Ice
Accretion\IceAccretion (ver 1.2.0.0)\IceAccretion\Input.cs:line 57
at System.Windows.Forms.Control.OnDoubleClick(EventArgs e)
at System.Windows.Forms.ListBox.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
IceAccretion
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Ice%20Accretion/IceAccretion%20(ver%201.2.0.0)/IceAccretion/bin/Release/IceAccretion.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 
P

Patrice

Is this an application that is shown in a browser or in its own Windows ?

ASPNET is to create web sites that are displayed in an internet browser...


Basically this error means that you are trying to use an object that is null
(not initialized). Check what you have on line 57...
 
M

Mark Rae [MVP]

hey well all files are saved as .cs
how do I tell ? :$

C# can be used to create WinForms applications as well as WebForms
applications.

If it runs on your desktop (e.g. like Word or Excel), it's almost certainly
a WinForms application.

If it runs in a web browser (e.g. like Google) it's almost certainly a
WebForms application.

Sounds very much like it's a WinForms application, in which case the correct
newsgroup would be

microsoft.public.dotnet.languages.csharp
 
M

Maddy

C# can be used to create WinForms applications as well as WebForms
applications.

If it runs on your desktop (e.g. like Word or Excel), it's almost certainly
a WinForms application.

If it runs in a web browser (e.g. like Google) it's almost certainly a
WebForms application.

Sounds very much like it's a WinForms application, in which case the correct
newsgroup would be

microsoft.public.dotnet.languages.csharp

mark it runs on my desktop...
and actually I did try seraching for a .csharp group but for some
reason it dint come up before...

thanks...


For Patrice..
I guess my main problem is that this error is totally RANDOM.
the program works fine with a certain set of input data files.
However it gives me this error for a different set of data files.
I have chekced the files thoroughly to see if they differ in anyway,
but they're EXACTLY the same format with just different numbers :S...
Its like the computer justs remembers a certain set of data and
rejects ANY other data, popping out this error.
 
A

Andrew Faust

As others said you are in the wrong group and you'll want to go post the
question and some code in microsoft.public.dotnet.languages.csharp.
However, as the only difference is the data files being used I'd say the
most likely causes are:

Differences in how the data is stored (tab delimited, csv, different column
names, different # of columns, file names, etc.)
Or
Where the files are located. Maybe the previous dev had hard coded paths.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top