VB.net store/select values in multiline listbox based on DB tables.
Posted on 2007-03-22
I have a pretty simple VB.net page displaying a logged in user's preferences that I am trying to add a new control to. I'm adding a multi line listbox which loads a list of countries from a table (lets say tblCountry). This table contains reference data of country names and country IDs.
However, when this listbox is loaded, I want it to select countries based on the current user's "preferred countries". Which means I need to store the user's selected countries in a different table somewhere - not the tblCountry table.
I have no problems loading the country list from tblCountry and binding it to the listbox but I can't work out how to also load and store the selected countries into another table and update the selected values of the multiline listbox on this user preferences page.