Hope this is in the right forum.
I have a page with a datareader which selects data from a database using the select command depending on the username, this then calls the password and checks it.
My problem is that when the userid isn't in my SQL database I get an error saying "no data found".
How can I put a check in so that when there is no data it returns a message?
My code so far is:
dim dr as sqldatareader = strsql.executereader
dr.read()
if dr("password"
= password.text then
response.write("OK"
else
response.write("PWord Error"
end if
I have a page with a datareader which selects data from a database using the select command depending on the username, this then calls the password and checks it.
My problem is that when the userid isn't in my SQL database I get an error saying "no data found".
How can I put a check in so that when there is no data it returns a message?
My code so far is:
dim dr as sqldatareader = strsql.executereader
dr.read()
if dr("password"
response.write("OK"
else
response.write("PWord Error"
end if