B
Bryan
I have a class 'TagType' with an ilist member 'Props' that holds a
collection of another class called 'Prop'. I let the user create
TagTypes and save multiple properties (Props) in them.
I am having a problem storing a Prop object in a TagType object. The
code below is giving me a "Object reference not set to an instance of
an object." error. I don't understand why
Dim t As TagType = Me.lstTagTypes.SelectedItem 'user selects
TagType from list
Dim p As New Prop 'create new prop, assign it fake data
With p
.Name = "Phone #"
.DataType = "String"
.Value = "555-5555"
End With
t.Props.Add(p) 'add prop to Props collection (ilist) of
selected TagType !!error!!
I am new to OOP, any help would be appreciated!
collection of another class called 'Prop'. I let the user create
TagTypes and save multiple properties (Props) in them.
I am having a problem storing a Prop object in a TagType object. The
code below is giving me a "Object reference not set to an instance of
an object." error. I don't understand why
Dim t As TagType = Me.lstTagTypes.SelectedItem 'user selects
TagType from list
Dim p As New Prop 'create new prop, assign it fake data
With p
.Name = "Phone #"
.DataType = "String"
.Value = "555-5555"
End With
t.Props.Add(p) 'add prop to Props collection (ilist) of
selected TagType !!error!!
I am new to OOP, any help would be appreciated!