Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows Application
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 2-Sep-12 19:43pm
Comments
pradiprenushe at 3-Sep-12 1:05am
   
What is problem then?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
indrajeet jadhav at 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 at 7-Sep-12 7:27am
   
can you post your sp code by improving questoin?
indrajeet jadhav at 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 at 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 at 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;
}
indrajeet jadhav at 7-Sep-12 7:35am
   
yes sir i write here IsActive 1 at the end of procedure.

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

  Print Answers RSS
0 OriginalGriff 406
1 Marcin Kozub 225
2 Sergey Alexandrovich Kryukov 205
3 Raul Iloc 170
4 Maciej Los 164
0 OriginalGriff 8,289
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,624
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 3 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100