Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
If txtuser.Text = "" Then
MsgBox("Please Enter a Username or Password, DOnt leave it blank", MsgBoxStyle.Exclamation, "Access Error")
ElseIf txtPass.Text = "" Then
MsgBox("Please Enter a Username or Password, DOnt leave it blank", MsgBoxStyle.Exclamation, "Access Error")
Else
End If
Dim ConStr As String = "server=localhost;database=library;uid=root;password=localhost;"
Dim conn As MySqlConnection
conn = New MySqlConnection(ConStr)
Dim qry As String = "select * from accesscode "
Dim ds As New DataSet
Dim dat As MySqlDataAdapter
dat = New MySqlDataAdapter(qry, conn)
dat.Fill(ds, "accesscode")
' Open connection
conn.Open()
If ds.Tables("accesscode").Rows(0).Item("username") = txtuser.Text And _
ds.Tables("accesscode").Rows(0).Item("password").ToString = txtPass.Text Then
Me.Hide()
About.Show()
Else
MsgBox("Access Denied", MsgBoxStyle.Critical, "Security error")
End If
txtPass.PasswordChar = "*"
End Sub
this code is running but it only reads the first column in my database...the other stored account,if i entered will be"Access Denied ..."
i hope someone can help me to solved this problem ..
thanks in advance for you help..