B Minster
B Minster

Reputation: 341

Values added to Settings.Default not persisting from one area

Problem: Items added to Settings.Default not persisting after page load. Desired Functionality: Values added to Settings.Default saved and will load on next use

I have a few different things that are stored in Settings.Default but one area isn't adding the values to the user.config file. I have a list of account numbers stored in Settings.Default.accountList. On load the form checks to see if there are values loaded in already and if not it loads in a list. That works fine. Later where the user can add a value it will do everything it is supposed to do except load to/stay in the user.config. The event handler looks like this:

accountNumber = FormOneMethods.NewAccount(accountNumber);
Settings.Default.accountList.Add(accountNumber);
Settings.Default.Save();

I added the .Save() later but that still didn't work. Why won't the values added persist?

Upvotes: 0

Views: 38

Answers (0)

Related Questions