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.
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.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)