January 23, 2012 at 12:04 am
how to write store procedure for login check
37 minutes ago | LINK
here iam having two tables
table1
table name tblLogin
tblLogin
LoginId
Name
Password
MemberId
table2
table name tblmembers
MemberId
FirstName
LastName
Gender
DOB
Mobile
Phone
AddressLine1
AddressLine2
Country
City
ZipCode
here i just want to check
username
password
user type
and after values are checked it has to display related row
like this
loginid
MemberId
FirstName
LastName
Gender
DOB
Mobile
Phone
AddressLine1
AddressLine2
Country
City
ZipCode
January 23, 2012 at 12:32 am
You can do this by just asking for the data row, in your application, if you dont get any results, you know the login failed
CREATE PROCEDURE [dbo].[sp_check_login]
@username VARCHAR(100),
@password VARCHAR(50)
AS
SELECT l.loginid, m.*
FROM tblLogin l INNER JOIN tblMembers m
ON l.memberid = m.memberid
WHERE l.name = @username AND l.password = @password
January 23, 2012 at 9:19 pm
thanks a lot your code was working perfectly
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply