S
Sankar
There is no dearth of this subject in this group, but I am not sure if
it answers this question. If this question is stupid, please let me
know it is and excuse my ignorance.
SQL Query: select user_id,first_name,last_name from user
I have a drop-down list that needs to fill in the name of the user in
the format "FirstName LastName" using standard databinding techniques.
This is the code that I have
A dataReader contains the resultset.
cboUser.DataSource = dataReader
cboUser.DataValueField = "user_id"
I do not know how to get the "FirstName LastName" in the dropdown list.
I tried something like
cboUser.DataTextField = String.Concat("first_name"," ","last_name")
and it is of no avail.
An error is thrown on the call to DataBind() and the message says that
"first_name last_name" is not comprehensible.
I am not at liberty to change the sql query to do the concatenation.
Is there a way out?
Thanks,
-Sankar
it answers this question. If this question is stupid, please let me
know it is and excuse my ignorance.
SQL Query: select user_id,first_name,last_name from user
I have a drop-down list that needs to fill in the name of the user in
the format "FirstName LastName" using standard databinding techniques.
This is the code that I have
A dataReader contains the resultset.
cboUser.DataSource = dataReader
cboUser.DataValueField = "user_id"
I do not know how to get the "FirstName LastName" in the dropdown list.
I tried something like
cboUser.DataTextField = String.Concat("first_name"," ","last_name")
and it is of no avail.
An error is thrown on the call to DataBind() and the message says that
"first_name last_name" is not comprehensible.
I am not at liberty to change the sql query to do the concatenation.
Is there a way out?
Thanks,
-Sankar