Hi all,
I'm trying to make a login form with VB but I'm having some trouble with searching through the datagrid.
I can login with the first name and password the the database but as soon as I try another name, it shows the messagebox.
Can anyone help me out?
Thanks in advance
I'm trying to make a login form with VB but I'm having some trouble with searching through the datagrid.
Code:
Dim blnValid As Boolean
Dim intTeller As Integer
'Dim intTeller As Integer
intTeller = EasybyteDataSet.Gebruikers.Rows.Count
MessageBox.Show(intTeller)
For intI = 0 To intTeller - 1
If txtNaam.Text <> EasybyteDataSet.Gebruikers.Rows(intI).Item("Naam") Then
blnValid = False
Else
For intJ = 0 To intTeller - 1
If txtWachtwoord.Text <> EasybyteDataSet.Gebruikers.Rows(intJ).Item("Password") Then
blnValid = False
Else
blnValid = True
End If
Exit For
Next
Exit For
End If
Next
If blnValid = True Then
gstrNaam = txtNaam.Text
txtNaam.Text = ""
txtWachtwoord.Text = ""
cntTeller.Enabled = True
Else
MessageBox.Show("Gebruikersnaam en/of wachtwoord bestaat niet", "Fout", MessageBoxButtons.OK, MessageBoxIcon.Error)
txtWachtwoord.Text = ""
End IfCan anyone help me out?
Thanks in advance