Binding two columns to a DropDownList

Discussion in 'ASP .Net' started by Simon Harvey, Jun 25, 2004.

  1. Simon Harvey

    Simon Harvey Guest

    Hi all,

    I have two columns in a databse that I wish to bind to a dropdownlist, one
    column as the value (or index) the other as the text value displayed.

    Does anyone know how I can achieve this?

    Thank you

    Simon
     
    Simon Harvey, Jun 25, 2004
    #1
    1. Advertising

  2. Simon Harvey

    Rick Spiewak Guest

    Just look at the properties window in the designer, you'll see that this
    capability is built in. You can set the DataSource (a dataset, for example)
    the DataMember (a datatable) the DataTextField, and the DataValueField.

    "Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
    news:%...
    > Hi all,
    >
    > I have two columns in a databse that I wish to bind to a dropdownlist, one
    > column as the value (or index) the other as the text value displayed.
    >
    > Does anyone know how I can achieve this?
    >
    > Thank you
    >
    > Simon
    >
    >
     
    Rick Spiewak, Jun 27, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Angela
    Replies:
    2
    Views:
    2,155
    David Wier
    Jun 7, 2004
  2. helpful sql
    Replies:
    0
    Views:
    849
    helpful sql
    May 19, 2005
  3. GenxLogic
    Replies:
    3
    Views:
    1,371
    andrewmcdonagh
    Dec 6, 2006
  4. quiggle

    Binding Two DataTable Columns to One DataGrid Column

    quiggle, Apr 2, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    195
    quiggle
    Apr 2, 2004
  5. Paolo

    Two dropdownlist and two tables...

    Paolo, Sep 19, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    155
    Paolo
    Sep 19, 2006
Loading...

Share This Page