showing multiple values from multiple db rows in a DropDownList

Discussion in 'ASP .Net' started by Schultz, Feb 13, 2005.

  1. Schultz

    Schultz Guest

    Is there anyway to include values from 2 (or more) separate db columns
    into a single DropDownList using VB.NET 03?


    I would like the visible Data to be in the following format:


    lname, fname (id number)


    thanks!
     
    Schultz, Feb 13, 2005
    #1
    1. Advertising

  2. Schultz

    Karl Seguin Guest

    Shultz:
    After you've pulled the data into your datatable, add a new column such as:

    dt.Columns.Add(new DataColumn("Display",
    System.Type.GetType("System.String"), "[Lname] + ',' + [Fname] + '(' +
    [IdNumber] + ')'"));

    and you can then set the DataTextField to "Display"

    Cheers,
    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Schultz" <> wrote in message
    news:...
    > Is there anyway to include values from 2 (or more) separate db columns
    > into a single DropDownList using VB.NET 03?
    >
    >
    > I would like the visible Data to be in the following format:
    >
    >
    > lname, fname (id number)
    >
    >
    > thanks!
    >
     
    Karl Seguin, Feb 14, 2005
    #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. Schultz
    Replies:
    1
    Views:
    4,205
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Feb 20, 2005
  2. Subba Rao via DotNetMonster.com

    script for moving rows up and down and traverse thru rows of HTML table

    Subba Rao via DotNetMonster.com, Mar 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    8,247
    Subba Rao via DotNetMonster.com
    Mar 19, 2005
  3. helpful sql
    Replies:
    0
    Views:
    824
    helpful sql
    May 19, 2005
  4. Ray Booysen
    Replies:
    2
    Views:
    652
    Ray Booysen
    Mar 28, 2006
  5. Andy B.
    Replies:
    2
    Views:
    1,246
    Alexey Smirnov
    Jun 8, 2009
Loading...

Share This Page