Guest User

Untitled

a guest
Dec 9th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. private void buttonLagreEndringer_Click(object sender, EventArgs e)
  2. {
  3.  
  4. // string epost = textBoxEpost.Text;
  5. // string oldpw = textBoxGammelPassord.Text;
  6. // string newpw = textBoxNyPassord.Text;
  7. int epost = 43;
  8. int newpw = 1234;
  9. string oldpw = "Drammen";
  10.  
  11. String dbconnect = "Server=129.241.151.172;Database=IT1901;User=root;Password=herp";
  12. MySqlConnection dbconn = new MySqlConnection(dbconnect);
  13. MySqlCommand cmd = dbconn.CreateCommand();
  14.  
  15.  
  16. cmd.CommandText = "INSERT INTO Kommune (kommuneID, kommunenavn, nummer) VALUES(@kommuneID, @kommunenavn, @nummer)";
  17.  
  18. cmd.Parameters.AddWithValue("@kommunenavn", textBoxEpost.Text);
  19. cmd.Parameters.AddWithValue("@nummer", textBoxNyPassord.Text);
  20. cmd.Parameters.AddWithValue("@kommuneID", textBoxEpost.Text);
  21.  
  22. dbconn.Open();
  23. cmd.ExecuteNonQuery();
  24. dbconn.Close();
  25. MessageBox.Show("Lagret");
  26.  
  27. }
Add Comment
Please, Sign In to add comment