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 = 1
DB.Entries.Add(temp)
[.net] VB.NET Arraylist "Object reference not set to an instance of an object."
Quote:Original post by WanMaster
Perhaps 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 Database
Do 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
public DB as New Database
Do 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
Quote:Original post by Machaira
You 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 Machaira
You 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? ;)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement