예제 #1
0
 private void Delete()
 {
     User user = new User() { uId=6};
     db.Users.Attach(user);
     db.Users.Remove(user);
     db.SaveChanges();
     Response.Write("删除成功");
 }
예제 #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("添加用户成功了");
 }