Link to home
Start Free TrialLog in
Avatar of grouchyfd
grouchyfdFlag for United States of America

asked on

Is there a way to concatenate info from 2 database columns to display together in the same listbox control?

I use VS 2005. I am building a windows app. Is there a way to take info from 2 different database columns, like last name and first name, concatenate them into a listbox that will display in the form LastName, FirstName?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of maralans
maralans

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MageDribble
MageDribble

you are better off binding in VB.  If you move from SQL Server to Oracle (or other way), the concatenation changes from "+" to "||".  You could write a function on SQL Server that concatenates and then re-create it on Oracle if you change databases.

However, if you bind in VB - you won't have to worry about swapping database back-ends.

Sancler's suggestion shows how to bind in VB
Avatar of grouchyfd

ASKER

It's has taken me a while to get it to work through the VB side. Thank you all for your help. I was able to use the sql statement earlier thru the QA. I wanted to make it work thru the app. side so it wouldn't be dependant on the database.