Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource

后端 未结 3 1177
说谎
说谎 2021-01-14 16:28

Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource. The error is displayed when I bind the grid view

var list = d         


        
3条回答
  •  滥情空心
    2021-01-14 17:04

    Could the above not be shortend to..

    var empInfo = dal.GetEmployeebyName(name);
    
    GridViewEmployee.DataSource = empInfo.ToList();
    GridViewEmployee.DataBind();
    

提交回复
热议问题