好的,所以我有组合框,其数据源是 linq 查询的结果
//load QA names
var qaNames =
from a in db.LUT_Employees
where a.position == "Supervisor" && a.department == "Quality Assurance"
select new { a, Names = a.lastName + ", " + a.firstName };
cboQASupervisor.DataSource = qaNames;
cboQASupervisor.DisplayMember = "Names";
我遇到的问题是当我尝试添加下一行代码时
cboQASupervisor.ValueMember = "ID";
我在运行时收到一个错误,它无法转换匿名类型。我该如何解决?
更正:错误是:
无法绑定到新值成员。参数名称:值