   [.net] VB.NET  Arraylist "Object reference not set to an instance of an object."
    Dim temp As Entry  temp = New Entry  temp.Surname = TextBox_AddSurname.Text  temp.Address1 = TextBox_AddAdd1.Text  temp.Address2 = TextBox_AddAdd2.Text  temp.PostCode = TextBox_AddPC.Text  temp.PhoneNum = TextBox_AddPN.Text  temp.InvoiceNum = TextBox_AddIN.Text  temp.InstallNum = TextBox_AddIsN.Text  temp.Windows = 1   temp.Doors = 1DB.Entries.Add(temp)Iv tried to add an object to my Arraylist, but it tells me the refernce isnt set to an object. The compiler tells me to use the New keyword, which Im doing. What am I doing wrong?   
  Perhaps either DB or its Entries property is not instantiated.;Quote:Original post by WanMasterPerhaps either DB or its Entries property is not instantiated.Yup it looks like maybe you have a problem with your Entry class?;  Cheers, that worked. I did public DB as New DatabaseDo I have to instantiate all my vars in VB? Im familiar with c++ so does VB have constructors? I know i could Google but thats at least 4 clicks away   ;  You have to instantiate any variable that's a reference type.   ;Quote:Original post by MachairaYou have to instantiate any variable that's a reference type.Not if it's a shared(static in C#) class.;Quote:Original post by daviangelQuote:Original post by MachairaYou have to instantiate any variable that's a reference type.Not if it's a shared(static in C#) class.Then it's not technically a variable, is it? ;)   