Databind

J

Jay

Hello all. I'm populating a dropdown box using the databind(). I'm trying to
get two values in one selection.
So far I have this:
ddlPersonType.DataTextField = "PersDtlName"

I would like to make it so the text is:

PersDtlName (PersDtlID)
John Doe (1)

Does anyone have any suggestions?

Thanks,

- J
 
S

S. Justin Gengo

Concatenate the fields in your SQL statement.

I have an example of this in the code library on my website:
www.aboutfortunate.com

Rest the "All Languages" drop down to SQL and then click on the entry
titled: "Concatenate fields in SQL Statement"

Happy coding!

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
S

S. Justin Gengo

Jay,

Here I'll copy and paste it for you:


SELECT pk_CustomerId, (lastName + ', ' + firstName) AS fullName FROM
tblCustomers



--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top