|
-
Sep 30th, 2007, 05:13 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] How to? fill the list box from a particular table based on selection?
I am wanting to select a table for the FROM part:
categoryComm = new SqlCommand("SELECT ListRelationID, ListRelation FROM ListRelationTbl", conn);
based on what value the user selects in a listbox.
How can I replace ListRelationTbl" with the value from the listbox?
" + listboxtableslct.Value + "", conn);
conn.Open();
// Create command to read the categories
reader = categoryComm.ExecuteReader();
// Populate the list of categories
categoryLst.DataSource = reader;
categoryLst.DataValueField = "ListRelationID";
categoryLst.DataTextField = "ListRelation";
Thank you so much in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|