Combobox Help!!!

nido12

Member
Joined
Dec 12, 2005
Messages
5
Programming Experience
1-3
Dear All...

A Combo Box Named Report To Which Shows The Supervisers Of The Employee

But In The Database This Field "reportto" Should Be Integer

Wut To Do In This Case???

What Should Be In The Displaymember And In The Valuemember And Wut Is The Difference????
 
If you're using a ComboBox to display a name or description and provide access to a corresponding key value, the DisplayMember should be set to the name of the column you want to display, which is quite logical. The ValueMember should be set to the name of the column that contains the keys. When the user then selects an item you use the SelectedValue to get the key value for the SelectedItem.
 
Normally the Combobox display member is set to the field that you want to show in the combobox.
 
ill give you small exaple
if you have database having two columns id,name
if you want to display names in the combobox then set displaymember to name and whenever you select the name in the combobox you want tht employees id set displayvalue to id
so by selecting employee name you are actually selecting id
hope im clear


 
Back
Top