Reputation: 45
I have tried creating a SQL query in vb and i keep getting an error. Here is my code:
SELECT userid, Email, [password], [First Name]
, [Last Name], [Date of Birth], Major
FROM Students
WHERE userid = @StudentIdParam AND [password] = @studentPassParam
And the error is as follows:
error in WHERE clause near '@' unable to parse query text.
Any help will be greatly appreciated.
Upvotes: 1
Views: 2626
Reputation: 9577
cmd.Parameters.Add("@StudentIdParam", studentIdParam)
cmd.Parameters.Add("@studentPassParam", studentPassParam)
...before executing the query.
Upvotes: 1