Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

login authentication against database 1

Status
Not open for further replies.

aaronjonmartin

Technical User
Jul 9, 2002
475
GB
Hi guys, im trying to create a login page which checks against a database to log a user in.

At the moment i have two textboxes taking username and password. Then the text from the username textbox is used to query the database and if it exists return the password. I now want to check the password entered into the password textbox against the data returned by the stored procedure but i dont know how to?

I have filled a dataset with the data returned from the stored procedure but how do i check the password returned against the password textbox?

Also i could be doing this totally the wrong way, if you have any advice on how to do it better please let me know. Im not using visual studio and the language im using is VB.

Any help with this would be greatly appreciated.

thanks
Aaron

"It's so much easier to suggest solutions when you don't know too much about the problem."
Malcolm Forbes (1919 - 1990)
 
I think like this is best, maybe I don't understand something

"select * from users where username = '" + usernameString + "' AND password = '" + passwordString + "';"

Where usernameString and passwordString are the values taken from your two textboxes. Then check if the dataset is empty. If it is, login failed, if it is not, login passed.
 
awesome i got it working doing that, thanks mate

"It's so much easier to suggest solutions when you don't know too much about the problem."
Malcolm Forbes (1919 - 1990)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top