Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

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(sValue)) Then
                _pJoinTables = _pJoinTables & "," & sValue 'Error on this line first &
            End If
        End Set
    End Property

End Class
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks