The ObjectContext instance has been disposed and can no longer be used for operations that require a connection. in Reference table

后端 未结 4 732
陌清茗
陌清茗 2020-12-08 14:21

I have two tables Customers and Country and use ( Entity Framework with vs 2012 )

4条回答
  •  旧巷少年郎
    2020-12-08 14:58

    there is one more solution, using ViewBag

    using(var db = new jQGridEntities())
    {
        var customers = db.Customers.Where(c=>c.Country!=null).ToList();
        ViewBag.customerlist= customers;
    }
    

提交回复
热议问题