Need example of dual list box, with database code
Posted on 2007-11-18
Hello - Thanks, MacEx for your code snip for dual list boxes. Could you please elaborate on that, for use against a couple of database tables?
I'm trying to work up a page that allows a primary system user to specify the allowable divisions a regular staff-level user can access in a corporate financial system.
Given a lookup table like:
DivID / DivDesc
...and a user control table like:
UserID / DivID
...I'd like to display the DivID's (that the user isn't already set up for) on the left-hand list box, and the DivID's they ARE set up for on the right-hand list box
I know what the queries (or views, or SP's) that pull the rowsource for the two list boxes needs to look like (I've done this before in MS Access/VBA). I just don't know how to code the list box events in VB.NET to pull the recordset's, and update them after an update.
And is that even the best way? Database updates after every listbox update, or pull the 2 rst's into arrays, do all the back & forth locally, until they click "Save", and then update the user control table? (this will be an intranet application)
Thanks; I hope this isn't over-reaching