How to check username and password from database







In this tutorial I am going to tell you  how to validate a user's credentials match or not and how to retrieve a user's password and email address from a database.




ALTER procedure [dbo].[PasswordRecovery]
(@username nvarchar(30),
@email nvarchar(30),
@password nvarchar(50) output,
@msg nvarchar(30) output)
 as
  begin
  if exists(select *from Emp_login where user_id=@username and email_id=@email)
  begin
  select @password=password from Emp_login where user_id=@username and email_id=@email
  set @msg='yes'
  end
  else
  begin
  set @msg='Credential dose not match. Retry!'
  end
end

1 comments

thanks bro...this is one of the topic that u cleared excellenty


EmoticonEmoticon