Error: Object reference not set to an instance of an object.


Error: Object reference not set to an instance of an object.

Description: This error throws when a program trying to access a member fields, or function types, on an object reference that points to null. Using NullReferenceException, will throw exception when the variable is null.

Solution: Put a null check on the object and also implement Exception Handling techniques to catch the error.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s