在我的表中,我有一个 and 字段firstname
,lastname
现在我想要在组合框中设置firstname
和lastname
,displaymember
但我不知道该怎么做。
像这样的东西
cmbEmployees.DataSource = GetEmployees();
//something like below line which doesn't work
cmbEmployees.DisplayMember = "lastname, first_name";
cmbEmployees.ValueMember = "id";
我怎样才能做到这一点?这样lastname
和firstname
都将显示在combobox