Databinding to dropdownlist

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Billy Jacobs

    #1

    Databinding to dropdownlist

    I have a table with two fields for a person's name.(e.g.
    FirstName, LastName).

    Is there a way to bind both fields with a space between
    them to a dropdownlist control so that the full name is
    displayed?

    Thanks,

    Billy Jacobs
  • John

    #2
    Re: Databinding to dropdownlist

    sql="Select Id, FullName=FirstN ame + ' ' + LastName from table";

    Now you have two columns, Id and FullName, to bind to the DropDownList.

    John



    "Billy Jacobs" <billnospam@csa .com> wrote in message
    news:07d701c357 0c$a177e880$a30 1280a@phx.gbl.. .[color=blue]
    > I have a table with two fields for a person's name.(e.g.
    > FirstName, LastName).
    >
    > Is there a way to bind both fields with a space between
    > them to a dropdownlist control so that the full name is
    > displayed?
    >
    > Thanks,
    >
    > Billy Jacobs[/color]


    Comment

    • Etienne Charland

      #3
      Re: Databinding to dropdownlist

      Hi Billy, you can add another column to the table, set the values you want
      to display in that column, and bind to it.

      Etienne

      "Billy Jacobs" <billnospam@csa .com> wrote in message
      news:07d701c357 0c$a177e880$a30 1280a@phx.gbl.. .[color=blue]
      > I have a table with two fields for a person's name.(e.g.
      > FirstName, LastName).
      >
      > Is there a way to bind both fields with a space between
      > them to a dropdownlist control so that the full name is
      > displayed?
      >
      > Thanks,
      >
      > Billy Jacobs[/color]


      Comment

      Working...