Murray Brown
asked on
VB.net get list of items from class
Hi
I was given the following code to load a list of names to a class object. How do I get these items so that I can loop through each one of these
Module Module1
Sub Main()
Dim objCls As New Class1
objCls.JointTables = "Tab1"
objCls.JointTables = "Tab2"
objCls.JointTables = "Tab3"
objCls.JointTables = "Tab2"
End Sub
End Module
Public Class Class1
Private _pJoinTables As String
Public Sub New()
_pJoinTables = ""
End Sub
Property JointTables() As String
Get
Return _pJoinTables
End Get
Set(ByVal sValue As String)
If (Not _pJoinTables.Contains(sVal ue)) Then
_pJoinTables = _pJoinTables & "," & sValue 'Error on this line first &
End If
End Set
End Property
End Class
I was given the following code to load a list of names to a class object. How do I get these items so that I can loop through each one of these
Module Module1
Sub Main()
Dim objCls As New Class1
objCls.JointTables = "Tab1"
objCls.JointTables = "Tab2"
objCls.JointTables = "Tab3"
objCls.JointTables = "Tab2"
End Sub
End Module
Public Class Class1
Private _pJoinTables As String
Public Sub New()
_pJoinTables = ""
End Sub
Property JointTables() As String
Get
Return _pJoinTables
End Get
Set(ByVal sValue As String)
If (Not _pJoinTables.Contains(sVal
_pJoinTables = _pJoinTables & "," & sValue 'Error on this line first &
End If
End Set
End Property
End Class
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER