Welcome Guest! To enable all features please Login or Register.


Go to last post Go to first unread
Offline Rondotnet  
#1 Posted : 17 May 2011 21:56:35(UTC)

Rank: YAF Forumling


Joined: 17/05/2011(UTC)
Posts: 1

Hey, I am a novice in dot net programming. I run a program in window 7 which runs perfectly in xp. It returns the following error which performing certain operations. Any idea what the problem is?

System.NullReferenceException: Object reference not set to an instance of an object.

at SMS.FrmMain.TreeView2_MouseUp(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.TreeView.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)
Offline jpweber  
#2 Posted : 10 December 2012 06:16:20(UTC)

Rank: YAF Commander


Joined: 21/03/2012(UTC)
Posts: 126

Thanks: 38 times
Was thanked: 11 time(s) in 9 post(s)
The error indicates an object is null.

For reference, if needed, MSDN Object Null Information

Regardless, it appears your db.config not setup right. Please make sure the information in that file is correct.

So open up your YAF ---> db.config with notepad or whatever, and this:

<add name="yafnet" connectionString="Data Source=sql2k805.XXXXXXXXXXXXXXXXXXXXXX;User ID=SQL2008R2_XXXXXXXXX_USER;Password=YOURPASSWORD"
providerName="System.Data.SqlClient" />

Make sure all that information is correct and is the proper information for your database. If you're using a shared host, go into your host's control panel and get the database information from there.

Upload the db.config and replace the old one and refresh your browser or clear the cache, and things should work properly.
Jason Weber
USS Vision YAF
"Money is better than poverty, if only for financial reasons"
Offline evanchatter  
#3 Posted : 30 October 2018 07:10:04(UTC)

Rank: YAF Forumling


Joined: 30/10/2018(UTC)
Posts: 1
United Arab Emirates
Location: dubai

To fully understand why a NullReferenceException is thrown, it is important to know the difference between value types and reference types.

So, if you're dealing with value types, NullReferenceExceptions can not occur. Though you need to keep alert when dealing with reference types!

Only reference types, as the name is suggesting, can hold references or point literally to nothing (or 'null'). Whereas value types always contain a value.

Reference types (these ones must be checked):

  • dynamic

Value types (you can simply ignore these ones):

  • Numeric types
    Integral types
    Floating-point types
    User defined structs
Rss Feed  Atom Feed
Users browsing this topic
Similar Topics
System.NullReferenceException: Object reference not set to an instance of an object. (YAF Issues & Bugs Discussion)
by mirwin 17/10/2008 07:19:33(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.