Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Object reference not set to an instance of an object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maddy - 22 Oct 2007 15:22 GMT
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.
Mark Rae [MVP] - 22 Oct 2007 15:31 GMT
>   at System.Windows.Forms.Control.OnDoubleClick(EventArgs e)

Are you sure this is an ASP.NET app...?

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Maddy - 22 Oct 2007 15:37 GMT
Hey Mark...all files are .cs
how do I tell? :$
Patrice - 22 Oct 2007 15:45 GMT
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...
--
Patrice

> Hey Mark...all files are .cs
> how do I tell? :$
Maddy - 22 Oct 2007 15:39 GMT
hey well all files are  saved as .cs
how do I tell ? :$
Mark Rae [MVP] - 22 Oct 2007 15:48 GMT
> 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

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Maddy - 22 Oct 2007 16:02 GMT
> > hey well all files are  saved as .cs
> > how do I tell ? :$
[quoted text clipped - 16 lines]
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

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.
Andrew Faust - 23 Oct 2007 03:11 GMT
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.

Signature

Andrew Faust
andrew[at]andrewfaust.com
http://www.andrewfaust.com

> Hello Everyone,
> I am working as a coop student and do not have much experience with
[quoted text clipped - 80 lines]
> will be sent to the JIT debugger registered on the computer
> rather than be handled by this dialog box.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.