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?
Use a stored proc to concatenate the name fields and bind to it instead
of a SQL statement.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
I'm actually using Access as my database, so I'm wondering if I can do
this without using a stored proc.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Friday, March 16, 2012
Listbox DataBinding
Labels:
asp,
aspx,
bind,
database,
databinding,
datatextfield,
display,
dropdownlistbox,
fields,
listbox,
net,
page
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment