We help IT Professionals succeed at work.
Get Started

VB.net save a list to settings

Murray Brown
Murray Brown asked
Last Modified: 2012-06-22
Hi. I was given the following code that I use to save a list of items
against a class object. I want to be able to assign this to a Setting
How do I do this so that when I close and open the project I can
reuse the list?

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
            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
Watch Question
Most Valuable Expert 2011
Top Expert 2015
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE