Hi
Move this before the while loop
BindingList<member> comboBoxList = new BindingList<member>();</member></member>
Binding list is a signle instance, no need to instantiate again and again inside the loop
inside the while loop get this
Member mem1 = new Member("Student A", "Student A", 1, "XXXXXXX");
Member mem2 = new Member("Student B", "Student B", 2, "XXXXXXX");
comboBoxList.Add(mem1);
comboBoxList.Add(mem2);
You have to populate the binding list with members
Then out side the while loop assign this to the combobox
comboBox1.DataSource = comboBoxList;
comboBox1.DisplayMember = "FirstName";
comboBox1.ValueMember = "ID";
Then in the
Selection Change Event
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Member mem=(Member)comboBox1.SelectedItem;
textBox1.Text = mem.FirstName;
}
What you are doing is creating a binding list, but that binding list is empty.