Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 20th, 2004, 09:50 PM
Authorized User
 
Join Date: Dec 2004
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting Error - "Object reference not set to an in

Hi,

In my C# application, i am getting an error - "Object reference not set to an instance of an object.". This application is running round the clock(stock appln) and i have just enabled additional logging. This error is happening for a particular sequence of events. I suspect at the end of the day, when i colse and open objects/file streams/writers, i encounter this.

Any idea on the curcumstances under which this normally hapens? I believe you guys might have come across this. I will get back to you with more info after checking the log( need to wait one day for that error).

Thanks in advance for the help.

Regards,
Peri



 
Old December 21st, 2004, 06:31 PM
Kep Kep is offline
Authorized User
 
Join Date: Aug 2003
Location: Melbourne, VIC, Australia.
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This normally happens when you try to access a member of an object before creating that object.

Can you give us more info about your code?

Kep.
 
Old December 24th, 2004, 11:20 AM
Authorized User
 
Join Date: Dec 2004
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Kep.

Managed to sole it... in my hashtable variable, i was trying to access the key which was not there. I found this by setting a breakpoint under "debug" menu and chooing under the "exceptions".

Thanks and regards,
Peri






Similar Threads
Thread Thread Starter Forum Replies Last Post
object reference not set to instant of an object shahidrasul ASP.NET 2.0 Basics 1 September 5th, 2008 02:01 PM
Error - Object reference not set to an instance ? venkikrao VB.NET 2 July 5th, 2007 01:00 AM
Error: Object Reference not set to an instance. Nosfe_X VB Databases Basics 2 June 23rd, 2006 04:10 PM
Object Reference not set to an instance of object srinivas_chakka ASP.NET 1.0 and 1.1 Professional 0 February 8th, 2006 11:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.