Sir, I need your help in the following topic.
I am often confused of value member and display member in comboBox fill funtion.
I have no doubt on filling a non- dependent table.
but in the case of a foreign key column, I am became confused.
let me know which column should be set as Valuemember and Displaymember?
I have a knowledge that primary key to be set as Display and the column we want in
combobox to be set as Valuemember. Is this correct?
Value member and Display member
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 10, 2013, 3:19 AM EDT
hi,
name suggest itself....
DisplayMember property represent the text information displayed in drop down / combo box.
ValueMember property represent the value information that can be used to stored in database.
yes, generally valuemember is id(int) field which may foreign key column in to main table.
for example
I have one customer table and it has city field which foreign key column of City Table.
then displaymember property contain CityName and valuemember contain CityId
hope this will help you.
Bineesh ViswanathRank #1,680 · 907 reputationPosted Jul 10, 2013, 4:10 AM EDT