为什么我的列表框显示

时间:2014-11-18 03:35:53

标签: c# winforms listbox

使用以下内容,

DataTable Customers = GetAllCustomers();
lbCustomers.DataSource = Customers;
listBox1.DisplayMember = "firstName";
listBox1.ValueMember = "phoneNumber";

我的列表框中充满了System.Data.DataRowView我做错了什么?

1 个答案:

答案 0 :(得分:0)

不应该

DataTable Customers = GetAllCustomers();
lbCustomers.DataSource = Customers;
lbCustomers.DisplayMember = "firstName";
lbCustomers.ValueMember = "phoneNumber";