showing multiple values from multiple db rows in a DropDownList

S

Schultz

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!
 
K

Karl Seguin

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top