Click to See Complete Forum and Search --> : DropDownList


johnsonlim026
March 20th, 2008, 05:55 AM
Hi, i am a new bee in asp.net.I have a questiob to ask over here.

My table structure are as below:

EmpCode EmpName
0001 John
0002 Mike
0003 Steve


I pump the EmpName to the dropDownList and and let the user to select the employee.Is it possible when user select the employee, instead from getting the Empname as a result, the dropDownList return the empCode for me as a result.
Does anyone has idea to do this?

Shuja Ali
March 20th, 2008, 07:27 AM
A drop down list has two properties, DataValueField and DataTextField. You can set the first one as EmpCode and the second one as EmpName. While retrieving you can just retrieve the DataValueField.

johnsonlim026
March 30th, 2008, 08:56 PM
hi, got it.Thanks