What I need to do is read an ArrayList in My.Settings and add another ArrayList to it.
The first think I'm trying to do is load My.Settings.Records into myArrayList. I'm not quite sure on the proper way to do this.
I've tried things such as
I'm not sure if I need New and I'm not sure if I need .Clone or .CopyToCode:Dim myArrayList As ArrayList = My.Settings.Records
Then I have another ArrayList myArrayList2. To get this into myArrayList I've done:
Then to save it back to My.Settings I've doneCode:Dim myArr As String() = myArrayList2.ToArray(GetType(String)) myArrayList.AddRange(myArr)
The problem is I keep on getting Object reference not set to an instance of an object error on the AddRange line.Code:My.Settings.Records = myArrayList
My.Settings.Records is definitely an ArrayList and it will sometimes = Nothing. The objects will only ever be strings.




Reply With Quote