943,697 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Marked Solved
  • Views: 4041
  • ASP.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Feb 12th, 2008
0

good way of validating login info vs SQL D/B

Expand Post »
Hi all. just wondered if there was a quick and easy way (or good tutoriaL) to validate user input (on a login control) against a SQL database where the users username and password credentials are stored. Any suggestions will be greatly appreciated! Thanks for your time.
Reputation Points: 256
Solved Threads: 72
Nearly a Posting Virtuoso
majestic0110 is offline Offline
1,306 posts
since Oct 2007
Feb 12th, 2008
0

Re: good way of validating login info vs SQL D/B

the easiest way is to enable asp.net membership provider, it creates all the required tables and procedures for you. drag and drop create user wizard to your webform, then run the page. when you create your first user, asp.net creates the membership tables in your AppData folder. then drag and drop a login control, when you enter the credentials that you previously registered, you will see that login successes or fails.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Feb 12th, 2008
0

Re: good way of validating login info vs SQL D/B

that simple eh ? many thanks for your reply. Does this method provide a means of edting login credentials? For example if I have an administrator user type and a general user type, the admin should be able to edit the general user
Reputation Points: 256
Solved Threads: 72
Nearly a Posting Virtuoso
majestic0110 is offline Offline
1,306 posts
since Oct 2007
Feb 12th, 2008
0

Re: good way of validating login info vs SQL D/B

Yes, you have all the controls in your Toolbar if you are using Visual Studio 2005, or 2008.
Reputation Points: 12
Solved Threads: 11
Junior Poster in Training
ManicCW is offline Offline
95 posts
since Nov 2005
Feb 12th, 2008
0

Re: good way of validating login info vs SQL D/B

hmm ok thanks fo your ideas both of you. however what serkansendur has suggested is great but I do not want to create users onthefly. I want to have a prebuilt DB to validate against you see. any suggestions ?
Reputation Points: 256
Solved Threads: 72
Nearly a Posting Virtuoso
majestic0110 is offline Offline
1,306 posts
since Oct 2007
Feb 13th, 2008
0

Re: good way of validating login info vs SQL D/B

hi majestic0110,
There is ASP Login Control exists in VS 2005 OR VS 2008, but you still want to use traditional database technique to design login control. For this, i have one article which help's you a lot.
Just check this link, hope this will help you.

http://www.4guysfromrolla.com/webtech/100500-1.shtml

If problem persist then feel free to share with us.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting
Reputation Points: 10
Solved Threads: 4
Light Poster
dilipv is offline Offline
30 posts
since Feb 2008
Feb 13th, 2008
0

Re: good way of validating login info vs SQL D/B

that simple eh ? many thanks for your reply. Does this method provide a means of edting login credentials? For example if I have an administrator user type and a general user type, the admin should be able to edit the general user
Everything you can do with login controls,can be done programmatically. To create users belonging to different groups, you must enable roles. Then programmatically you can add users to those roles. Also you can use create user wizard to set user roles. Add an extra step to create user wizard and add a checkbox there determining whether the user is an admin or not. Create user wizard is derived from wizard control so it can be added as many steps as wanted
Last edited by serkan sendur; Feb 13th, 2008 at 6:54 am.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Feb 13th, 2008
0

Re: good way of validating login info vs SQL D/B

hmm ok thanks fo your ideas both of you. however what serkansendur has suggested is great but I do not want to create users onthefly. I want to have a prebuilt DB to validate against you see. any suggestions ?
ok, basically you need to modify your web.config file's <authention element. set the authentication type to Forms. then create your own login page using your own textboxes. query your database with the credentials, if the credentials match then in the button_click handler of your login button add this code : FormsAuthentication.RedirectFromLoginPage(string username,bool createPersistentCookie); if you want you can add a checkbox so that user credentials be remembered. pass the checkbox.checked value to createPersistentCookie parameter.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Feb 13th, 2008
0

Re: good way of validating login info vs SQL D/B

the trouble I am mainly having is in connecting to the Db. When I use the WAT utility I keep getting error messages saying I am not connected to db
Reputation Points: 256
Solved Threads: 72
Nearly a Posting Virtuoso
majestic0110 is offline Offline
1,306 posts
since Oct 2007
Feb 13th, 2008
0

Re: good way of validating login info vs SQL D/B

you dont have to use WAT, you can manually configure the web.config file. google search the element name like <authentication or just type web.config authentication or so.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Saving text in asp.net
Next Thread in ASP.NET Forum Timeline: Using UserControls in ASP.NET





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC