private void button_change_Click(object sender, EventArgs e) { ArrayList userInfo = new ArrayList(); String givenOldPass = textBox_oldpw.Text; String givenNewPass = textBox_newpw.Text; String givenConfPass = textBox_confirm.Text; if (String.IsNullOrEmpty(textBox_oldpw.Text) || String.IsNullOrEmpty(textBox_newpw.Text) || String.IsNullOrEmpty(textBox_confirm.Text)) { MessageBox.Show("Fill up all data"); } else { DatabaseHelperClass ob1 = new DatabaseHelperClass(); if (ob1.checkPassword(givenOldPass, givenID)) { if (String.Compare(givenNewPass, givenConfPass) == 0) { userInfo.Add(textBox_newpw.Text); DatabaseHelperClass ob = new DatabaseHelperClass(userInfo); if (ob.changePassword(givenID)) { MessageBox.Show("Password Changed"); } else { MessageBox.Show("Error Changing Password"); } } else { MessageBox.Show("Password Doesn't Match"); } } else { MessageBox.Show("Wrong old password !"); } } }