Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- con.Open();
- SqlCommand command = new SqlCommand("select 1 from tblLogin where Username = @user and Securityquestion = @securityquestion and Answer = @answer", con);
- command.Parameters.AddWithValue("@user", txtUsername.Text);
- command.Parameters.AddWithValue("@securityqestion", ddlSecurityquestions.Text);
- command.Parameters.AddWithValue("@answer", txtAnswer.Text);
- var value = command.ExecuteScalar();
- con.Close();
- if (Object.Equals(value, 1))
- {
- this.Hide();
- FormLoginWW2 ss = new FormLoginWW2();
- ss.Show();
- }
- else
- {
- MessageBox.Show("Error");
- }
- //here it needs to be the username from the first form
- SqlCommand command;
- command = new SqlCommand("select THEUSERNAMEFROMFORM1 from tblLogin where Username = @user", con);
- command.Parameters.AddWithValue("@user", labelUsername.Text);
- if (txtPassword.Text == txtConfirmpassword.Text)
- {
- SqlCommand cmd = new SqlCommand("update tblLogin SET Password = @password where Username = @user ", con);
- cmd.Parameters.AddWithValue("@password", txtPassword.Text);
- MessageBox.Show("Succes");
- this.Hide();
- FormLogin ss = new FormLogin();
- ss.Show();
- }
- else
- {
- MessageBox.Show("Error.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement