R
rapataa
hi all,
I'm trying to get the following to work:
I have an objectmodel containing users and groups. A user is part of the
users collection and a group contains users.
-------
public class User {///// contains user methods & property functions}
public class Users : System.Collections.CollectionBase {//// contains add,
remove and item functions}
public class Group
{
public Users users = null;
public void fillUsers()
{
User oUser = new User();
oUser.getUserbyID(4);
Users.Add(oUser)
}
}
PROBLEM: the fillUsers function raises an "Object reference not set to an
instance of an object." error. But, if I use the same code (outside the
Group class) for adding a user to the collection Users, it works fine!!
thanks!
I'm trying to get the following to work:
I have an objectmodel containing users and groups. A user is part of the
users collection and a group contains users.
-------
public class User {///// contains user methods & property functions}
public class Users : System.Collections.CollectionBase {//// contains add,
remove and item functions}
public class Group
{
public Users users = null;
public void fillUsers()
{
User oUser = new User();
oUser.getUserbyID(4);
Users.Add(oUser)
}
}
PROBLEM: the fillUsers function raises an "Object reference not set to an
instance of an object." error. But, if I use the same code (outside the
Group class) for adding a user to the collection Users, it works fine!!
thanks!