Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1.  
  2. if (password == confirmPass)
  3. {
  4. try
  5. {
  6. String connectionString = ConfigurationManager.ConnectionStrings["StuartRossDB"].ConnectionString;
  7. OleDbConnection connection = new OleDbConnection(connectionString);
  8. string query = "INSERT INTO Student (Title, FirstName, MiddleName, LastName, MaidenName, Gender, DateOfBirth, TelNum, MobNum, Email, Disabilities, Password) VALUES('"
  9. + title + "','"
  10. + fName + "','"
  11. + mName + "','"
  12. + lName + "','"
  13. + maiden + "','"
  14. + gender + "','"
  15. + DOB + "','"
  16. + telNum + "','"
  17. + mobNum + "','"
  18. + email + "','"
  19. + disabilities + "','"
  20. //+ address + "','"
  21. + password + "')";
  22.  
  23. OleDbCommand command = new OleDbCommand(query, connection);
  24.  
  25.  
  26.  
  27. connection.Open();
  28. command.ExecuteNonQuery();
  29. connection.Close();
  30.  
  31. }
  32. catch (Exception ex)
  33. {
  34. message = ex.ToString();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement