Object reference not set to an instance

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. It is WinForms application.

To explain briefly, the program calculates the amount of ice
formed on wires during icestorms using data from climate canada.

The program was working fine until last week. But once I downloaded
new
data files 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.

Its as if the computer jus remembers the first set of data, as I have
checked the files thoroughly and they are EXACTLY the same with just
different numbers :S.

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__b77a5c56­1934e089/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/Syste­m.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__b03f5f7f11d50a­3a/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.
 
D

DCP

One thing you can look at is:
Make sure the new excel spread sheet has same worksheet name as previous
one.

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. It is WinForms application.

To explain briefly, the program calculates the amount of ice
formed on wires during icestorms using data from climate canada.

The program was working fine until last week. But once I downloaded
new
data files 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.

Its as if the computer jus remembers the first set of data, as I have
checked the files thoroughly and they are EXACTLY the same with just
different numbers :S.

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__b77a5c56­1934e089/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/Syste­m.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__b03f5f7f11d50a­3a/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.
 
M

Maddy

Hey Thanks for replying..
I checked..they're the same :(.. EVERY SINGLE Thing is the same except
for the actual numbers
 
Z

zacks

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. It is WinForms application.

I would run the application with the IDE and let it tell you which
statement was throwing the exception. The basic problem you are having
is that you are referencing an object that has not been instatiated
yet, as in:

ClassA classA;
int i;

classA.propertyname = i

In this case the fix would be to:

ClassA classA;
int i;

classA = new ClassA();
classA.propertyname = i
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

What is the offending line?

Once you find it, try to see what instance used in that line has no value,
then check why it has no value

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
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. It is WinForms application.

To explain briefly, the program calculates the amount of ice
formed on wires during icestorms using data from climate canada.

The program was working fine until last week. But once I downloaded
new
data files 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.

Its as if the computer jus remembers the first set of data, as I have
checked the files thoroughly and they are EXACTLY the same with just
different numbers :S.

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__b77a5c56­1934e089/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/Syste­m.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__b03f5f7f11d50a­3a/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.
 

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