Listbox DataBinding

J

J. Babe

I am trying to bind data from a database to a DropDownListBox on an
..aspx page.

I want to display 2 fields in listbox (listbox's .DataTextField = two
fields in the database "Employee.FName" & " " & "Employee.LName" -
space in between the names)

and also have the listbox's .DataValueField = Employee.EmployeeID
field.

I tried to do this by creating a field through the SQL query used to
build a dataset, but I got the error "Dynamic SQL generation not
supported (or similiar)". I was wondering if there is another way to
display these two fields in the listbox?
 
B

Barry

Use a stored proc to concatenate the name fields and bind to it instead
of a SQL statement.
 
J

J. Babe

I'm actually using Access as my database, so I'm wondering if I can do
this without using a stored proc.
 

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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top