Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not supported

前端 未结 3 1127
有刺的猬
有刺的猬 2020-11-28 11:10

Am coding on visual studio 2012 and using Entity Model as my Data layer. However, my drop down control with the Linq statement tend to thro

3条回答
  •  感动是毒
    2020-11-28 11:52

    Or if you want to avoid writing a LINQ expression you could just do this:

    var dbContext = new EF.CustomerEntities();
    gvCustomers.DataSource = dbContext.CustomersTable.ToList();
    

提交回复
热议问题