Results 1 to 3 of 3

Thread: [RESOLVED] [2008] StringDictionary saved in My.Setting? (Object reference error)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2008
    Posts
    72

    [RESOLVED] [2008] StringDictionary saved in My.Setting? (Object reference error)

    I have System.Collections.Specialized.StringDictionary set up in My.Settings.

    However when I try to add to it, I get the error "Object reference not set to an instance of an object." I have not been able to figure out how to get around this one but im sure someone here knows exactly whats wrong.

    Thank you very much for any help!
    Last edited by Bohlas_DuBhunkus; Oct 12th, 2008 at 06:48 PM.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] StringDictionary saved in My.Setting? (Object reference error)

    do you mean a System.Collections.Specialized.StringCollection?

    have a look at the my.settings stringcollections link in my signature

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2008
    Posts
    72

    Re: [2008] StringDictionary saved in My.Setting? (Object reference error)

    Works great. Slightly modified, but the link in your sig showed me how to do it.
    Code:
    If My.Settings.Stuff Is Nothing Then
    My.Settings.Stuff = New Specialized.StringDictionary
    End If
    My.Settings.Stuff.Add("TheStuff","Cant get enough, of the stuff")
    My.Settings.Save()
    You been a big help paul!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width