Craig Davis

Craig Davis

  • NA
  • 40
  • 0

Accessing object within list

Jul 23 2015 3:07 PM
I have a parent object Z which contains a list of child objects.  I would like to access the properties of the child objects within the list.
 
I wrote code to access the first object in the list.  The code compiles correctly but returns a (object reference not set to instance of an object) error when I run the application.
 
Here is part of the code:
 
zparentobject= new Zclass();
childclass zchildobject = new childclass();
zchildobject=zparentobject.listz[0];  * source of error*
 
Help?

Answers (2)