.EOF on type string not found?

windows

Guest
Sub Login(sender as Object, e as EventArgs)
Dim myConn As OleDbConnection = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & _
"C:\Profiles\Databases\Members.mdb;")

Dim MySQL = "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))

cmd.ExecuteNonQuery

IF MySQL.EOF THEN
NoUser.visible = True
Else
Response.Redirect("Account.aspx")
End If

MyConn.Close()
End Sub

*********
The Error Message:

Exception Details: System.MissingMemberException: Public member 'EOF' on type 'String' not found. On Line 20.

Source Error:


Line 18: cmd.ExecuteNonQuery
Line 19:
Line 20: IF MySQL.EOF THEN
Line 21: NoUser.visible = True
Line 22: Else

It's been a long while since I've did asp.net, and I cannot remember this error. Thx in Advance.MySQL is your SQL string and it doesn't have an EOF method or property.EOF is a property of the recordset, not a string holding a SQL statement.
 
Back
Top