Guest User

Untitled

a guest
Nov 30th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. private void LoginKnop_Click(object sender, System.EventArgs e)
  2. {
  3.  
  4. MySqlConnection con = new MySqlConnection("datasource=127.0.0.1;port=3306;username=root;password=JariR0800;database=test;");
  5. try
  6. {
  7.  
  8.  
  9. if (con.State == ConnectionState.Closed)
  10. {
  11. con.Open();
  12. loginLog.Text = "Database geconnect";
  13.  
  14. }
  15. }
  16. catch(MySqlException ex)
  17. {
  18. loginLog.Text = ex.ToString();
  19. }
  20. finally
  21. {
  22. con.Close();
  23. }
  24.  
  25. }
  26. }
Add Comment
Please, Sign In to add comment