Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > showing multiple values from multiple db rows in a DropDownList

Reply
Thread Tools

showing multiple values from multiple db rows in a DropDownList

 
 
Schultz
Guest
Posts: n/a
 
      02-13-2005
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!

 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      02-14-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> 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!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert DropDownList values to enum values Andy B. ASP .Net 2 06-08-2009 07:05 PM
dynamically add new rows and save data typed in these rows to a database Arjen Hoekstra ASP .Net 0 08-02-2005 12:15 PM
convert rows to columns and columns to rows helpful sql ASP .Net 0 05-19-2005 06:03 PM
script for moving rows up and down and traverse thru rows of HTML table Subba Rao via DotNetMonster.com ASP .Net 0 03-19-2005 06:46 AM
(Long)Showing Multiple DB Columns in a DropDownList Schultz ASP .Net 1 02-20-2005 04:49 AM



Advertisments