The following code throws this error:
An unhandled exception of type 'System.NullReferenceException' occurred in Classes.exe
Additional information: Object reference not set to an instance of an object.
When I call the form load function it throws the above error and Im not sure why.
C#
namespace Classes
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class ActSessions
{
public ActSessions()
{
//
// TODO: Add constructor logic here
//
}
public class User
{
public string name;
public string tabindex;
}
public User [] UserArray = new User[100];
}
}
private void Form1_Load(object sender, System.EventArgs e)
{
ActSessions Active = new ActSessions();
Active.UserArray[0].name = "JOHN"; //this line throw the error
}
Brandon Turner54 pointsPosted Mar 29, 2006, 4:50 AM EST
Jonathen Scalet4 pointsPosted Mar 29, 2006, 5:02 AM EST
Thanks,
Jon
Brandon Turner54 pointsPosted Mar 29, 2006, 8:18 AM EST