Click here to Skip to main content
15,905,682 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I want to check users selected security question and answer is matched with its database value which he is stores in sql server at the time registration.
Thank you,
Posted
Comments
pradiprenushe 3-Sep-12 1:05am    
What is problem then?

1 solution

Hi,


I understand what you want to do. but you also need to show what you have done so far. Anyway,

In your UserMaster table, you can create one flag(IsSecurityQuestionEnabled) indicating if user have checked Security Question or not. If so, you can create one another table(UserSecurityQuestion) with information about Question and Answer of that user.

While any user would like to change his/her password, you can prompt for Security question depending upon the flag you have defined in your UserMaster table.

For matching your security question and answer, you can write one StoredProcedure. StoredProcedure should contains all those select statements for matching security IsSecurityQuestionEnabled flag and UserSecurityQuestion table information for that user.

Hoe you got your required information.
Thanks
-Amit Gajjar
 
Share this answer
 
Comments
indrajeet jadhav 7-Sep-12 7:26am    
yes sir..i write here 1 store proc .i pass parameter 'SecurityQuestion' and 'Answer' here but its still nt wrkng.
AmitGajjar 7-Sep-12 7:27am    
can you post your sp code by improving questoin?
indrajeet jadhav 7-Sep-12 7:32am    
ALTER PROCEDURE dbo.SelectSecurityQueAndAnswerFromUserDetails

(
@SecurityQuestion nvarchar(MAX),
@Answer nvarchar(50)
)

AS
select * from UserDetails where(SecurityQuestion=@SecurityQuestion and Answer=@Answer)
RETURN
AmitGajjar 7-Sep-12 7:34am    
Instead of returning select query return count of the selected rows. if it returns 1 then success otherwise fail.
indrajeet jadhav 7-Sep-12 7:34am    
and the code i write a method here...
public DataTable SelectSecurityQueAndAns()
{
DataTable dtCheckSecQue = new DataTable();
DAL.UserDetailTableAdapters.SelectSecurityQueAndAnswerFromUserDetailsTableAdapter objCheckSec = new DAL.UserDetailTableAdapters.SelectSecurityQueAndAnswerFromUserDetailsTableAdapter();
try
{
//dtCheckSecQue = objCheckSec.SelectSecurityQueAndAnswerFromUserDet(UserId);
dtCheckSecQue = objCheckSec.SelectSecurityQueAndAnswerFromUserDet(SecurityQuestion,Answer);
}
catch (Exception ex)
{

BAL.ExceptionLogger.LogInfo(ex);
}
return dtCheckSecQue;
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900