怎样解决“出现用户代码未处理 EntityCommandExecutionException”
小弟最近在学习MVC3的知识。在网上看了个音乐项目的教程。试着跟做。
在controller里想获取数据库中所有资料。以下代码出错。不知如何解决。请高手指教!谢谢!
提示“出现用户代码未处理 EntityCommandExecutionException”
public class UserController : Controller { CarDbEntities cde = new CarDbEntities(); public ActionResult Index() { var model = cde.Cars.ToList(); //出错行 return this.View(model); } }