two-column display member for data-bound combo box

In VB.NET 2005, I have a data-bound combo box.  I've clicked the smart tag on it, selected a Data Source, Display Member, and Value Member.  My question is:  Can I select TWO columns to display as the Display Member?  For example:  The value member is an employee ID.  But I'd like the display member to be from two columns, employee first name and employee last name with a space in between.  Thanks!
Who is Participating?
Wayne Taylor (webtubbs)Connect With a Mentor Commented:
Hi redmission,

If you use a DataAdapter to fill a dataset, you can modify the SELECT statement to concatenate 2 fields....

    SELECT *,  ([FirstName] & " " & [LastName]) AS FullName FROM YourTable

...then set the display member to [FullName].


redmissionAuthor Commented:
Thanks webtubbs...that did it!  Here is my SQL Query on that I entered on the TableAdapter in Design View for the Fill method:  

SELECT     *, OFFER1 + N' / ' + OFFER2 AS Expr1

This allowed me to select the OfferBindingSource as the DataSource of the combo box, with a Display Member of Expr1.  The only problem was that if one of the offers was wouldn't display the Expr1 for that record at all.  I just set all the nulls in the DB to be blanks...but still.  Other than that, It works great!  You saved the day!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.