How do I assign "SelectedIndex" to a DDL list per record returned from a db query??

mhaggarty

New member
Joined
Nov 15, 2007
Messages
1
Programming Experience
Beginner
How do I assign "SelectedIndex" to a DDL list per record returned from a db query??

Hi all (first timer here),

[I posted this to the "Components" section but thought this might be a "General Discussion" item....I apologize if the duplicity is annoying :mad: to anyone.]

I'm pretty new to vb.net and have inheritted a custom (vb.net 1.1) application built by a developer that doesn't work here anymore.

I've been tasked with making modifications to the the application as follows:

Create a DDL on an existing form which is populated by a database call. When a user selects an item and submits the form have the selected item value (text) write back to the database for that record.

SO FAR I have all of this working above...(problem below):

When a client record is selected from a list reload the form with that clients data...this I have working as well but...I can't get the DDL to build with the selected to be the same as the text value returned from the db query for a client record.

Again, the value in the db is text and the value of the DDL items are text...I just need to figure out how to set the DDL selected value to be the value of what is being returned for the client record...

Any help would be greatly appreciated!! Code samples...???....anyone??

Thanks,
-Mark
 
Back
Top