Author |
Topic |
Mpilo
Yak Posting Veteran
52 Posts |
Posted - 2008-09-25 : 06:17:36
|
Hi i am looking for a stored procedure for login using two tables,using the USER table and MEMBER table.could you plz give the structure for creating a procedure the columns for User table areUsernamePasswwordthe columns for member table areMembershipNumSurnamei want a stored procedure that will use membershipnum as a password.the surname will be used as the UserNamemany thanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-25 : 06:29:26
|
[code]CREATE PROC GetLoginDetails@userName varchar(100)ASSELECT UserName,PasswordFROM(SELECT Username AS UserName,Password AS PasswordFROM UserUNION ALLSELECT SurName,MembershipNumFROM Member)tWHERE UserName=@UserNameGO[/code] |
|
|
Mpilo
Yak Posting Veteran
52 Posts |
Posted - 2008-09-25 : 07:05:19
|
can you plz give another example of a stored procedure for login using the data i provided earlier but a different format the procedure runs successfully but not whencreate login from my website. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-25 : 07:07:37
|
quote: Originally posted by Mpilo can you plz give another example of a stored procedure for login using the data i provided earlier but a different format the procedure runs successfully but not whencreate login from my website.
what do you mean by that? what are you passing from website? |
|
|
Mpilo
Yak Posting Veteran
52 Posts |
Posted - 2008-09-25 : 07:19:08
|
i want a stored procedure that will use membershipnum as a password.the surname will be used as the UserNamewhat i mean is that when we create the user login ,the username and the password must be created using the membershipnum and surname.quote: Originally posted by visakh16
quote: Originally posted by Mpilo can you plz give another example of a stored procedure for login using the data i provided earlier but a different format the procedure runs successfully but not whencreate login from my website.
what do you mean by that? what are you passing from website?
|
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-25 : 07:23:20
|
what all values will be passed to stored procedure from front end? |
|
|
Mpilo
Yak Posting Veteran
52 Posts |
Posted - 2008-09-25 : 07:35:29
|
Thanks it works..quote: Originally posted by visakh16
CREATE PROC GetLoginDetails@userName varchar(100)ASSELECT UserName,PasswordFROM(SELECT Username AS UserName,Password AS PasswordFROM UserUNION ALLSELECT SurName,MembershipNumFROM Member)tWHERE UserName=@UserNameGO
|
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2008-09-25 : 11:32:31
|
If you are using Microsoft memeberhip provider, the above will not work.You have to use the microsoft memberhsip provider and web.config file to configure your security options.With c# you dont have to build such complex codes, authentication is done by} if (Membership.ValidateUser(Login1.Username,Login1.Password) { e.Authenitcated = true; } else { e.Authenticated = false; }} And you dont need a SP to create users, its done with one line of codeMemebrship.Createuser("mpilo","afrika","mpilo@sqlteam.com"); And the good thing, passwords are encrypted for you, making life a lot easier.read up on 1. Roles2. Authentication3. AuthorizationUsing Microsoft memebrship provider |
|
|
|