hello guys,
I don't know what went wrong when I write this
Dim sql = "SELECT Stud_ID FROM STUDENT WHERE Stud_ID = ' " & txtstudID.Text & " ' AND password = ' " & txtPassword.Text & " ' "
cmd = New OleDbCommand(sql, myConn)
myConn.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader()
Try
If dr.Read = FalseThen
MessageBox.Show("Authentication failed.")
Else
MessageBox.Show("Login successfully...")
' Assign this form's TextBox to the Object Variable
studID = txtstudID
studpass = txtPassword
studentmain.Show()
Me.Hide()
EndIf
Catch ex As Exception
MsgBox(ex.Message)
EndTry
myConn.Close()
the error keep pointing to Dim dr As OleDbDataReader = cmd.ExecuteReader(). Did I miss something?
I don't know what went wrong when I write this
Dim sql = "SELECT Stud_ID FROM STUDENT WHERE Stud_ID = ' " & txtstudID.Text & " ' AND password = ' " & txtPassword.Text & " ' "
cmd = New OleDbCommand(sql, myConn)
myConn.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader()
Try
If dr.Read = FalseThen
MessageBox.Show("Authentication failed.")
Else
MessageBox.Show("Login successfully...")
' Assign this form's TextBox to the Object Variable
studID = txtstudID
studpass = txtPassword
studentmain.Show()
Me.Hide()
EndIf
Catch ex As Exception
MsgBox(ex.Message)
EndTry
myConn.Close()
the error keep pointing to Dim dr As OleDbDataReader = cmd.ExecuteReader(). Did I miss something?