dropdownlist-concat two fields-can it be done

C

ctb

I am not sure how to, or even if you can do this. I have
tried several things.
I have a drop down list that is databound to a
datareader. I wish to set the DataTextField to a
concatentation of first and last name that are stored in
the database.

any idea if there is a way to do this?
Thanks
 
C

ctb

I will try this, especially the first option
but, one more question
I also bind the datafieldvalue to the Member_id in the
drop down list.
In my select statement can I select another field
(member_id) in addition to the concatenated fields in the
AS clause.
 
S

S. Justin Gengo

Yes, you can select as many fields as you want!

SELECT Member_id, (lastName + ', ' + firstName) AS fullName From tblNames




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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top