Combine two database columns into one string in a drop down list

I have a drop down list that needs to be populated with an output of two different columns combined into one.  I need to do this by the vb code behind and not query string so when the user selects a value in the dropdownlist I can make a query off that selection and resplit the two columns.  So far I have this code and it just displays the Vehicle table but I need LocationDescription + Vehicle on one index.
ElseIf ddlSelectGSA.SelectedValue = "Joint" Then
            ddlShow.Items.Clear()
            ddlShow.Visible = True
            sql = "SELECT LocationDescription, Vehicle FROM VehicleScheduler.dbo.tblVehicles ORDER BY LocationDescription"
            myDataTable = New DataTable
            myDataTable = getData(sql)

            ddlShow.Items.Add(New ListItem("", "0"))
            buildDD(sql, ddlShow)
            ValReqDDLSelect.Visible = False

Open in new window

LVL 1
gfedzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jesus RodriguezIT ManagerCommented:
You can do it by adding more than one colum to the drop down. Check this link that I have from codeproject and you can get the code from there

http://www.codeproject.com/KB/custom-controls/multiColsDD_List.aspx
soujanya_gCommented:
Hi
You get 2dattabase colums as one colum by concating them in procedur as

Select Column1+ "  "+Column2 as YourColumn from table

and populate your dropdown list
amarsaleCommented:
you have to iterate through the items in the DataTable and keep on adding items to the drop down list one by one.


For Each datarow in datatable.Rows

          dropdownlist1.items.add(datarow("LocationDescription") + datarow("Vehicle"))
       
Next

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gfedzAuthor Commented:
That's what I was looking for.  Thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.