private void button1_Click(object sender, EventArgs e) { var p1 = pass1.Text; var p2 = pass2.Text; if (p1 == p2) { comm = con.CreateCommand(); comm.CommandText = "Update project.user_account" + " set password = @pass where u_id='" + UserInfo.Name + "'"; comm.Parameters.AddWithValue("@pass", p2); int rowsAffected = comm.ExecuteNonQuery(); MessageBox.Show("password updated!"); this.Close(); EditAcc newform = (EditAcc)Application.OpenForms["EditAcc"]; newform.Close(); EditAcc fm = new EditAcc(); fm.Show(); } else { MessageBox.Show("password is not the same or can't blank!"); pass1.Clear(); pass2.Clear(); pass1.Select(); } }
private void EditAcc_Click(object sender, EventArgs e) { EditAcc f2 = new EditAcc(); f2.Show(); }