Client-side editing of collections and values.

drew4663

Well-known member
Joined
May 3, 2007
Messages
62
Programming Experience
1-3
I have a predefined list of collections and values set for different functions. I want these lists and values to be edited by the client. Questions:

1. How would I go about getting hard coded values changed by user action?
Example... 5 departments listed. User wants to add or edit one of the lists values. I have done this before but there was a database involved. In this particular case a database will not be used.

2. How could I retrieve the values and collections from...let's say an xml file? Is it possible?

I tried to search for option 2 but the search engine always threw up an error saying that I had to use words that were bigger than three characters. Soooooo it made it a little difficult for search for vb.net and xml file. Anyway, much help and/or direction would be great.

FYI writing in vb.
 
oooook, 20 views no help..here.... I'll start

'When button is clicked
combobox1.items.add(textbox1.text)

'Now I just need it to save the text. It stores it until the app is closed.


I tried using a databse and I kept getting an error saying that the combobox.masterset something doesn't allow update.
Here is what I had: me.DepartmentDBTableAdapter.Update(me.MasterDataSet.DepartmentDB)

I think I have confused myself. :)
 
Obviously you can't change hard-coded values. You need to store these values externally and then read them into your app at run time. All you need to do is add a StringCollection to your projects Settings. You can then read it via My.Settings and any changes you make to it will be automatically saved at shutdown.

That last assumes that the Setting has User scope. If you require Application scope then you will need to save the changes yourself. For an example see the documentation for the ConfigurationManager.OpenExeConfiguration method.
 
Back
Top