Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create a new user object.
- user newUser = new user
- {
- user_email = "bclau_90@yahoo.com",
- user_rank = 10,
- user_password = "password"
- };
- // Add the new object to the users collection.
- LearnASPDataContext myDB = new LearnASPDataContext();
- myDB.users.InsertOnSubmit(newUser);
- // Submit the change to the database.
- try
- {
- myDB.SubmitChanges();
- }
- catch (Exception e)
- {
- return e.Message;
- // Make some adjustments.
- // ...
- // Try again.
- //myDB.SubmitChanges();
- }
Add Comment
Please, Sign In to add comment