how do i use asp.net to check password

milesb

Newcomer
Joined
Feb 16, 2004
Messages
3
how do i compare a password and username to those in a database.
i'm trying to set up a default page with login that checks in a database for the password and username, if they exist pass the user to the next page otherwise prompt with an error if not found.
 
you write an sql statement that attempts to retrieve a record matching the users input. e.g
Visual Basic:
Dim strSQL As String = "select * from customers where CustomerCode = '" & (loginnamevariable) & "'" & _
                            "and password = '" & (passwordvariable) & "' ;"

fill a dataset with the result. if the rowcount of the table in the dataset is 1 you've got a match so let them in otherwise kick them out.
 
hi, thank you for the reply.
can i fill a dataset with the user id, password and access level column from a database and check for user name password and access level eg. 'D' doctor, 'N' nurse, etc by querying it?
 
i have a table in my database the has userid, password and access level. that code works great for the username and password but how do i get the access level so i can direct them to the proper page?
 
Back
Top