Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void buttonLagreEndringer_Click(object sender, EventArgs e)
- {
- // string epost = textBoxEpost.Text;
- // string oldpw = textBoxGammelPassord.Text;
- // string newpw = textBoxNyPassord.Text;
- int epost = 43;
- int newpw = 1234;
- string oldpw = "Drammen";
- String dbconnect = "Server=129.241.151.172;Database=IT1901;User=root;Password=herp";
- MySqlConnection dbconn = new MySqlConnection(dbconnect);
- MySqlCommand cmd = dbconn.CreateCommand();
- cmd.CommandText = "INSERT INTO Kommune (kommuneID, kommunenavn, nummer) VALUES(@kommuneID, @kommunenavn, @nummer)";
- cmd.Parameters.AddWithValue("@kommunenavn", textBoxEpost.Text);
- cmd.Parameters.AddWithValue("@nummer", textBoxNyPassord.Text);
- cmd.Parameters.AddWithValue("@kommuneID", textBoxEpost.Text);
- dbconn.Open();
- cmd.ExecuteNonQuery();
- dbconn.Close();
- MessageBox.Show("Lagret");
- }
Add Comment
Please, Sign In to add comment