Well the first thing is that a String value does not have a EOF property.
You can do it a couple of ways. If all you are trying to do is to establish that something came back, then the fastest way to do this is probably like this:
Code:
Dim MySQL as string = "SELECT * FROM MEMBERS WHERE User_Id = @User_Id AND User_Password = @User_Password "
MyConn.Open()
Dim Cmd as New OleDbCommand(MySQL, MyConn)
cmd.Parameters.Add(New OleDbParameter("@User_Id", User_Id.text))
cmd.Parameters.Add(New OleDbParameter("@User_Password", User_Password.text))
Dim myReader as OleDbDataReader
myReader = cmd.ExecuteReader()
If myReader.HasRows Then
NoUser.visible = True
Else
Response.Redirect("Account.aspx")
End If
myReader.Close()
MyConn.Close()
If you need a different way you could do the If statement this way.
Code:
If myReader.Read() Then
NoUser.visible = True
Else
Response.Redirect("Account.aspx")
End If
myReader.Close()
MyConn.Close()
* note that the HasRows is NOT available in 2002 (v1.0.3705) of the framework, only 1.1 (v1.1.4322)
Ben Miller
Bookmarks