Guest User

Untitled

a guest
Feb 17th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. [HttpPost]
  2. public ActionResult Register(User model)
  3. {
  4. DateTime bla = new DateTime(2012, 12, 12);
  5. try
  6. {
  7. User user = new User
  8. {
  9. gid = 1,
  10. cid = 1,
  11. firstName = model.firstName,
  12. lastName = model.lastName,
  13. email = model.email,
  14. username = model.username,
  15. password = model.password,
  16. creationDate = bla,
  17. active = 1
  18. };
  19. myContext.Users.AddObject(user);
  20. myContext.SaveChanges();
  21.  
  22. }
  23. catch (Exception ex)
  24. {
  25. throw ex;
  26. }
  27.  
  28. return View();
  29. }
  30.  
  31. [id] [int] IDENTITY(1,1) NOT NULL,
  32. [cid] [int] NULL,
  33. [gid] [int] NULL,
  34. [firstName] [nvarchar](100) NOT NULL,
  35. [lastName] [nvarchar](100) NOT NULL,
  36. [email] [nvarchar](max) NOT NULL,
  37. [username] [nvarchar](100) NOT NULL,
  38. [password] [nvarchar](100) NOT NULL,
  39. [creationDate] [datetime] NOT NULL,
  40. [active] [int] NOT NULL,
  41.  
  42. {"An error occurred while updating the entries. See the inner exception for details."}
  43. {"The member with identity '' does not exist in the metadata collection.rnParameter name: identity"}
  44.  
  45. select 'trigger called, i am here'
  46.  
  47. select column
  48.  
  49. select @variable=column
  50.  
  51. select newid()
  52.  
  53. [HttpPost]
  54. public ActionResult Register(User model)
  55. {
  56. DateTime bla = new DateTime(2012, 12, 12);
  57. try
  58. {
  59. model.gid = 1;
  60. model.cid = 1;
  61. model.creationDate = bla;
  62. model.active = 1;
  63.  
  64. myContext.Users.AddObject(model);
  65. myContext.SaveChanges();
  66.  
  67. }
  68. catch (Exception ex)
  69. {
  70. Console.WriteLine(ex);
  71. throw;
  72. }
  73.  
  74. return View();
  75. }
  76.  
  77. foreach (var comp in colorstyle.Companions)
  78. comp.LinkCS = db.ColorStyles.Find(comp.LinkColorStyleId);
Add Comment
Please, Sign In to add comment