Shaitan00 Posted February 11, 2005 Posted February 11, 2005 Given a Dataset [oRecs] obtained from an SQL Table (2 colums, [X] and [Y]) and a dropdown list [ddlList] (C# web application [asp.net]). I want the dropdownlust [ddlList] to be populated with the [Y] column results from the Dataset [oRecs]. Currently I have the following code: ddlDevice.DataSource = oRecs; This does not generate any errors but the dropdown list box (when run) does not have any contents. Is there something I need to do? [like specify the column I want to list? how?] Quote
Administrators PlausiblyDamp Posted February 11, 2005 Administrators Posted February 11, 2005 You also need to set the DisplayMember to the name of the column you want to display and then call .DataBind on the drop down list control. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.