Click here to Skip to main content
11,805,316 members (66,449 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# Windows Application
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 18:43pm
pradiprenushe at 3-Sep-12 1:05am
What is problem then?

1 solution

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

Solution 1


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.
-Amit Gajjar
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)

select * from UserDetails where(SecurityQuestion=@SecurityQuestion and Answer=@Answer)
@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();
//dtCheckSecQue = objCheckSec.SelectSecurityQueAndAnswerFromUserDet(UserId);
dtCheckSecQue = objCheckSec.SelectSecurityQueAndAnswerFromUserDet(SecurityQuestion,Answer);
catch (Exception 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 315
1 Sergey Alexandrovich Kryukov 200
2 Richard Deeming 200
3 CPallini 160
4 CHill60 150
0 OriginalGriff 3,265
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 3 Sep 2012
Copyright © CodeProject, 1999-2015
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