S
sara_222
Hello all,
plz , i have the following code , which take student id and
passowrd,then check the id if it is found ,check password if it is
tru, if the password and id are true,the student can log in the
system, if the password if false ,he can try 3 times,if the id is not
recognized,the terminal is locked for 5 minutes.
when i compiled the code, the error message appered on the
dr=cm.executereader
i didn't know what is the problem with sql command.
code
...............
public sub log(byval num as integer,byval pass as string)
Dim cnn As New
SqlConnection("server=(local);database=db1;Trusted_Connection=yes")
Dim cm As New SqlCommand("select * from student where id=@num", cnn)
Dim dr As SqlDataReader
cnn.Open()
dr = cm.ExecuteReader
dr.Read()
If dr("id") = num Then
If dr("pass") = pass Then
MsgBox("login")
Else
MsgBox("invalid password")
End If
Else
MsgBox("Id is not recognized")
End If
dr.Close()
end sub
......................
plz help me , i am student and this is course project
Thankx
sara
Posted at: http://www.groupsrv.com
plz , i have the following code , which take student id and
passowrd,then check the id if it is found ,check password if it is
tru, if the password and id are true,the student can log in the
system, if the password if false ,he can try 3 times,if the id is not
recognized,the terminal is locked for 5 minutes.
when i compiled the code, the error message appered on the
dr=cm.executereader
i didn't know what is the problem with sql command.
code
...............
public sub log(byval num as integer,byval pass as string)
Dim cnn As New
SqlConnection("server=(local);database=db1;Trusted_Connection=yes")
Dim cm As New SqlCommand("select * from student where id=@num", cnn)
Dim dr As SqlDataReader
cnn.Open()
dr = cm.ExecuteReader
dr.Read()
If dr("id") = num Then
If dr("pass") = pass Then
MsgBox("login")
Else
MsgBox("invalid password")
End If
Else
MsgBox("Id is not recognized")
End If
dr.Close()
end sub
......................
plz help me , i am student and this is course project
Thankx
sara
Posted at: http://www.groupsrv.com