Advertisement
Guest User

Untitled

a guest
Jan 9th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. [WebMethod]
  2. public bool clientRegister(string email,string password)
  3. {
  4. string connStr = "server=localhost;user=root;database=trackingsystem;port=3306;password=root";
  5. MySqlConnection conn = new MySqlConnection(connStr);
  6. try
  7. {
  8. conn.Open();
  9. string sql = "insert INTO client(email,password) VALUES(@email, @password)";
  10. MySqlCommand cmd = new MySqlCommand(sql, conn);
  11. cmd.Parameters.AddWithValue("@email", email);
  12. cmd.Parameters.AddWithValue("@password", password);
  13. cmd.ExecuteReader();
  14. conn.Close();
  15. return true;
  16. }
  17.  
  18.  
  19. catch (Exception ex)
  20. {
  21. System.Diagnostics.Debug.WriteLine(ex.StackTrace);
  22. return false;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement