Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5984881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:26:42+00:00 2026-05-22T22:26:42+00:00

I know: Application settings can be stored as any data type that is XML

  • 0

I know:

Application settings can be stored as any data type that is XML serializable or has a TypeConverter that implements ToString/FromString. The most common types are String, Integer, and Boolean, but you can also store values as Color, Object, or as a connection string.

I have a ListDictionary class setting – which is serializable but everytime I start up my app again it is null despite creating, assigning and saving a ListDictionary to my settings:

Properties.Settings.Default.Preferences = new System.Collections.Specialized.ListDictionary();
Properties.Settings.Default.Preferences.Add(1, "test");
Properties.Settings.Default.Save();

How can I use such a class as an application setting? I need a dictionary type collection as a setting…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:26:43+00:00Added an answer on May 22, 2026 at 10:26 pm

    There are a set of things i would like you to try.

    1. make sure you create the settings scope as USER .

    http://msdn.microsoft.com/en-us/library/aa730869(v=vs.80).aspx
    add 2 strings(DictionaryKey and Dictionaryvalue) to the settings and set the scope as user and value as blank

    1. Settings doesn’t contain an option to add Dictionary . So what i would suggest is try this code

    make 2 sting settings and do this

    Properties.Settings.Default.Dictionarykey = "";// To empty previous settings 
    Properties.Settings.Default.Dictionaryvalue = "";// To empty previous settings 
    for (int i = 0; i < yourdictionarycount; i++ )
    {
    Properties.Settings.Default.Dictionarykey += i + "#";  // or any other value                
    Properties.Settings.Default.Dictionaryvalue += "test" + "#";  // or any other value                
    }
    Properties.Settings.Default.Save();
    

    And when you are retrieving the values

    use this code:

    public Dictionary<int, string> savedsettings = new Dictionary<int, string>();
    
    string[] eachkey = Properties.Settings.Default.Dictionarykey.Split('#');
    string[] value = Properties.Settings.Default.Dictionaryvalue.Split('#');
    
    for (int j = 0; j < eachkey.Length; j++)
    {
      savedsettings.Add(eachkey[i], eachvalue[i]);
    }
    //just to check if the values are being retrieved properly 
    Messagebox.Show(Properties.Settings.Default.Dictionarykey);
    

    Regards,

    Vivek Sampara

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to develop a file indexing application in python and wanted to know
I know its probably possible, but is it practical and doable to try and
I know its probably possible, but is it practical and doable to try and
I need to solve the following question which i can't get to work by
I would like to remove/delete a migration file. How would I go about doing
I have a login.jsp page which contains a login form. Once logged in the
After having read Ian Boyd 's constructor series questions ( 1 , 2 ,
I would like to update my SQL lite database with the native update-method of
I have several USB mass storage flash drives connected to a Ubuntu Linux computer
I'm doing some changes on my routes, and suddenly the following is appearing in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.