数据源是无效类型。它必须是 IListSource、IEnumerable 或 IDataSource。绑定网格视图时显示错误
var list = dal.GetEmployeebyName(name);
GridViewEmployee.DataSource = list;
GridViewEmployee.DataBind();
我有疑问
public EmployeeInfo GetEmployeebyName(String name)
{
using (var context = new HRMSEntities())
{
return context.EmployeeInfo.FirstOrDefault(e => e.FName == name);
}
}