1

I am working on a project in C# Winforms and one of the requirements is to allow the user to save various settings versions and give a name for each of them. The idea is to have a form, the user press the button Save Setting, enter a string in the text box for the name for that setting. Later the user can select from a comboBox which settings to use. I already created a standard setting which saves automatically when the user closes the form. Can you please direct me on how to that?

EDIT: The following forms demonstrate what I would like to achieve. The user enter some data in the textBoxes (form Main), then save the details giving to this setting the name of setting01 (form Save setting). Then enter some other details and give the name of setting02.
enter image description here enter image description here enter image description here

Now the user can use setting01 or setting02, which contain different values for the same textBox. enter image description here

Can please someone help me with this adventure?

  • Hi Grant, that you for your reply and link. I don't mean the simple setting using the settings dialog from the project's properties. The user can save many settings and give a name for each of them. –  Jul 10 '14 at 18:27
  • I hope is better now and thank you. –  Jul 10 '14 at 19:23
  • Ok, I am going to have a good look in the link, but if you have an example would be great. Thank you again. –  Jul 10 '14 at 19:56
  • Ok, I am going to have a good look into the link, but I think the answer is not there. Each settings contains various attributes. For example, in setting01 textBox01 have a value of 9, in setting02 the same textBox01 have the value of 11. –  Jul 10 '14 at 20:03

1 Answers1

0

Microsoft Developer Network has a nice tutorial on how to create a database and using it to store and retrieve data here

Hope it helps.

EDIT:

When the data is collected, do:

combobox1.items.add(data_that_was_collected);

  • Thank you for the answer but I know how to create a local database. My problem is how to save each setting collection attributes and retrieve them. In addition, I am not using SQL Server on this project but SQLite. I was actually thinking saving the settings in an xml file, but may be saving in a database would be easier. –  Jul 13 '14 at 09:41