views:

57

answers:

1

How-to store a questionary in database and maintain it using Enity Framework and ASP.NET ?

I have couple of question with certain numbers of answers.This questions are part of an users registration formular.

Something like:

Aaaaaaaa?

Checkbox1 - bbbbbbb Checkbox2 - ccccccc Checkbox3 - ddddddd Checkbox4 - eeeeeee

and more questions..

+1  A: 

I would set the tables up like the following, though it would depend on what you intend to do with the results of the questionnaire and if you are planning on adding questions.

  • Questions Table:
    • Fields: question_id, question_text
  • Answers Table
    • Fields: answer_id, question_id, answer_text
  • Results Table
    • Fields: result_id, answer_id, question_id, user_id, others_as_necessary

I hope this answers what you are asking, if not please clarify.

Mark