• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Save User Settings

I still after reading several articles to save user prefernces am very lost.

These are the settings I need to save.


Windows Program size

Heres the doozy:

I have a search form, as the user enter the field to search for.  If they choose to they can save that text to thier favorites.
Then I will have them click a favorite button(favbtn) that will display there saved strings.  When selected it will fill the txtbox for a search.

I just have a problem witht the saving of the favorites.  I would prefer and Ini file as it seems easier to use, or xml, but I would like to stay away from the registry.

Thanks for all the help, This site ROCKS.

  • 2
1 Solution
malanois, you are right  - XML seems to be reasonable solution. I would suggest the following schema:
  <USER username="john">
  <USER username="anny">

Samples for reading and writing XML:

malanoisAuthor Commented:
I have read thos before.

this is  a winforms program.

I still cannot get it to write or read

It does not really matters whether it's WinForms or WebForms. Could you publish your source code here, I'll try to figure out what you did wrong.
I think
1- You have to add a Typed Dataset to your project. (From the solution explorer, Add a new item, DataSet)
2- Add a Table to it to define all the data you need to store. (Add an ELEMENT from the toolbox to your dataset, name it, then add your fields with data types)
3- Anytime you need to save some data, use the following code: (I assume, you name your dataset as DATASET1)
   Dim ds As New Dataset1
   Dim r As New Dataset1.Table1Row=ds.Table1.NewRow

4- Anytime you need to load the data, write the following code:
   Dim ds As New Dataset1
   [Value1]=ds.Table1.Rows([INDEX YOU NEED]).[Preference1]
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now