Can someone point me to a tutorial on how to authenticate a user against a database? Written in VB please!
I dont want to use the config file to store user names and passwords...
Please help :D
Thanks!
Anjari
Printable View
Can someone point me to a tutorial on how to authenticate a user against a database? Written in VB please!
I dont want to use the config file to store user names and passwords...
Please help :D
Thanks!
Anjari
It depends on how complicated you want to make it, but the easiest would be something along the lines of;
If you successfully retreive a record, then both the username and password match.Code:strSQLStatement = "SELECT * FROM tblUsers "
strSQLStatement &= "WHERE strUserName = "
strSQLStatement &= "'" & strSomeUserName & " '"
strSQLStatement &= "AND strPassword = "
strSQLStatement &= "'" & strSomePassword & " '"
I just want to keep it simple... Im not going to be holding any top secret doccuments!! Could you expand the example a little bit for me? Please? I am still new... to the .net side..
I just want to ck the user name and password against a data table and then use a session to block access to the pages..
Anjari
Seems to me like plenderj gave you the info you need. What are you having troubles with? If it's the SQL part, there's plenty of online tutorials.
Gee Mike,
Thanks for the OBVIOUS reply... Now had you of read my first posting you would notice in fact that was what I asked for to begin with...
Thank you PenderJ for your assistance... I just need a little more help...
and Mike... I am sorry if I offended you with my reply... I just find it counter productive for people to post comments like yours... If I understood the example that was given to me I would not have replied with a request for addiditonal information... I am sure there are plenty of people that have a grasp on this but as I stated I am new to .net and need more help..
Anjari
Nah, I'm not offended, was actually trying to help. I wasn't trying to be a jerk or anything, was just wondering exactly what you're having trouble with. I can't point you to a tutorial, like you asked, but I do this type of coding all the time, so if you had a particular problem, I could probably help out.
That's why I asked if it was the SQL part you're having trouble with. If you want, post the code you've tried so far and point out where you're having difficulty.
This is an tutorial in asp not asp.net, using database. I am sure it will give you good idea how it works you should then be able to implement it in asp.netQuote:
Originally Posted by Anjari
http://www.4guysfromrolla.com/webtech/021600-1.shtml
Search the site for "Form Authentication" you should use that plus the DB for your authentication system. Thats the standard way of authentication user in asp.net.
Hope it helps.
Thanks folks!!
Just what I needed....
Anjari
No worries :thumb:Quote:
Originally Posted by Anjari
4GuysFromRolla has some brilliant article on asp.net, do check them out if you get a chance you will learn a lot, i have :).
Happy learning...
:wave: