• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

DBDataList Control

   I have an Access database that I have bound through an ADO control to a DataList box.  I'm trying to display two of the columns in this list box with a dash in between them.  The code to display just one of the columns is:
 
datalist1.listfield = "Country"
 
The "Country" is one of the column names in this table and when executed, it lists the elements of that column.  Do you have any suggestions as to how I can simply list the elements of two columns with a dash in between them?  
0
akedah
Asked:
akedah
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
Your ADO control have to return both fields you want alreaady concatenate toghether.

Select Field1 + ' - ' + Field2 AS FieldToDisplay
From TableX
0
 
akedahAuthor Commented:
It took me a while to figure out that I needed to code a SQL statement and since I didn't have a SQL book that dealt with VB, it took me a bit longer to get the correct syntax.  Thank you so very much for your help!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now