Exemplo n.º 1
0
 private void Delete()
 {
     User user = new User() { uId=6};
     db.Users.Attach(user);
     db.Users.Remove(user);
     db.SaveChanges();
     Response.Write("删除成功");
 }
Exemplo n.º 2
0
 private void Add()
 {
     User user = new User()
     {
         uName = "张信哲1",
         uAddtime = DateTime.Now,
         uLoginName = "zyh1",
         uPwd = "123",
         uIsDel = false
     };
     db.Users.Add(user);
     db.SaveChanges();
     Response.Write("添加用户成功了");
 }