dropdown list and data source

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a connection to a SQL database. One of the tables in the SQL
Database is DefendentInformation.

I would like to get the firstName and lastName fields from that table
combine them and add that as a value to the drop down list.

However, I don't know what to put in for the datasource property.

Any help would be appreciated
Brian
 
Hi,

Add a new calculated column to your dataset. Use that column as the
displaymember in the dropdownlist.

Dim dc As DataColumn

'

' Add a new column in clients table which

' is full name.

dc = New DataColumn("Name")

dc.DataType = System.Type.GetType("System.String")

dc.Expression = "LastName + ', ' + FirstName"

dsClient.Tables(0).Columns.Add(dc)



Ken

--------------------
Hi,

I have a connection to a SQL database. One of the tables in the SQL
Database is DefendentInformation.

I would like to get the firstName and lastName fields from that table
combine them and add that as a value to the drop down list.

However, I don't know what to put in for the datasource property.

Any help would be appreciated
Brian
 

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

Back
Top