
Originally Posted by
youngbucks
I want to use this to verify the login details but i want to add an extra parameter to check the Key they provided. Also i have a question as to what this line means exactly:
vb Code:
Dim command As New SqlCommand("SELECT COUNT(*) FROM User WHERE UserID = @UserID AND Password = @Password", connection)
I added this value to the code so far and how it affect the above snippet in its current state?:
vb Code:
.AddWithValue("@Key", Key)
That second line of code is saying that, wherever the place-holder "@Key" is found in the SQL code, it should be replaced with the value of the 'Key' variable. As you haven't changed the SQL code to include the "@Key" place-holder, that will have no effect. You have to change the SQL code to something like:
Code:
SELECT COUNT(*)
FROM User
WHERE UserID = @UserID
AND Password = @Password
AND [Key] = @Key