I try to create an forgot password application.
in the application, in order to get user password, user must do some input. there is 4 input : Username, Name, Security Question, and Security Answer.
Try
If TextBox8.Text <> "" Then
kueri = "select Username, Pass, Nama, SecQue, SecAns from Account where Username = '" + TextBox8.Text + "'"
conn.Open()
cmd = New SqlCommand(kueri, conn)
rd = cmd.ExecuteReader
rd.Read()
If TextBox8.Text = rd(0) Then
If TextBox9.Text = rd(2) Then
If ComboBox2.Text = rd(3) Then
If TextBox10.Text = rd(4) Then
Dim pwd As String
pwd = rd(1).ToString
Label10.Text = Dekrip(pwd, SecretKey)
Label10.Visible = True
conn.Close()
TextBox8.Text = ""
TextBox9.Text = ""
ComboBox2.Text = "- Pilih Salah Satu -"
TextBox10.Text = ""
Else
MsgBox(" BAD Security Answer")
End If
Else
MsgBox("BAD Security Question")
End If
Else
MsgBox("BAD Name")
End If
Else
MsgBox("BAD Username")
End If
Else
MsgBox("Please Insert Answer")
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Problem :
this SQL Command, "select Username, Pass, Nama, SecQue, SecAns from Account where Username = '" + TextBox8.Text + "'", need to get textbox8.text in order to get the password.
but, if user input some word that not exist in the database, my application get error from the database that say "word don't exist".
is there any other way to make this forgot password application ?
thanks