0
我试过这个。我没有遇到错误,我试图把断点跟踪和它的工作,但在数据库中din't更新...有什么问题?如何在MVC中使用LINQ EF更新数据库4
SanipexContext db = new SanipexContext();
public ActionResult ProductUpdate()
{
var exist = from e in db.SGRDetails
where e.SGRnumber == sgr && e.product == prodname
select e;
foreach (var s in exist)
{
s.percentage = 20;
}
db.SaveChanges();
}
谢谢:)现在运转。 – Reynan 2014-09-02 05:12:40