后台代码

 public ActionResult Edit(my m)//my实体类
        {
            testEntities t = new testEntities();//数据库上下文
            t.my.Attach(m);//my数据库中的表
            t.Entry(m).State = EntityState.Modified;
            t.SaveChanges();
            return Content("<script>alert('修改成功')</script>");
        }

 完美解决之前用反射解决的问题。。

相关文章:

  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案