private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == textBox2.Text)
     {
         forgotPass   fp   = new forgotPass();
         string       mail = fp.getMail();
         string       sql  = "UPDATE UserTable SET [password] = '" + hash.encrypt(textBox1.Text) + "' WHERE email = '" + mail + "'";
         OleDbCommand cmd  = new OleDbCommand(sql, con);
         cmd.CommandType = CommandType.Text;
         con.Open();
         try
         {
             cmd.ExecuteNonQuery();
             MessageBox.Show("password reset succesfully");
             login log = new login();
             this.Hide();
             log.Show();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
         con.Close();
     }
 }
        private void forgotPass_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Hide();
            forgotPass forgot = new forgotPass();

            forgot.Show();
        }