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:
Code
zparentobject= new Zclass();
childclass zchildobject = new childclass();
zchildobject=zparentobject.listz[0]; * source of error*Help?
Ashwani Chaudhary171 pointsPosted Jul 23, 2015, 9:24 PM EDT
Craig Davis37 pointsPosted Jul 24, 2015, 4:53 AM EDT