When does below message occur?

Object reference not set to an instance of an object

 Posted by Rajesh_Kumar on 1/21/2014 | Category: C# Interview questions | Views: 1813 | Points: 40

When we create any Class object but do not initialize with New keyword and we are dealing with that object or we are using that object anywhere in our code,then above error occurs.

For Example:-
DataTable dt_project = null;


In above code,we have not initialized datatable object and still adding columns to it.When we run,it will throw above error.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response