Last post Jul 22, 2011 09:28 AM by Kulrom
Jul 22, 2011 09:13 AM|star171|LINK
I have the following code below, how the line where it says : For Each c As councillor In councillorList i get the error: reference to a non shared member requires an object reference. Can someone please advise where i am going wrong?
Public Class councillors
Property councillorList As New List(Of councillor)
Public Class councillor
Property councillorID As Integer
Property Title As String = ""
Property Forenames As String = ""
Property Surname As String = ""
ReadOnly Property fullname As String
Return String.Concat(Forenames, " ", Surname)
Sub New(ByVal councillorID As Integer)
councillorID = councillorID
For Each c As councillor In councillorList
If c.councillorID = councillorID Then
Me = c
Jul 22, 2011 09:24 AM|ignatandrei|LINK
councillorList is in the class councillors
You try to use it in class councillor
Jul 22, 2011 09:28 AM|Kulrom|LINK
Hmm this seems like a big mess. Maybe it is better that you explain what are you trying to do so i can help further?
Btw, how do you add items to the Generic List?