V
Vili
Hi all
I am having problems with creating an functional questionnaire with
asp.net 2.0 and MSSQL 2005 database.
I have a table with field id (key & auto int), clientId (int),
QuestionId (int), And answer (nvarchar(255)) and a set of questions on
an another table.
Questions can have 0 or more answers
so a client 10 can have the table looking like this
Id|ClientId|QuestionId|Answer|
1 |10 |1 |Yes |
1 |10 |2 |Red |
1 |10 |2 |Blue |
1 |10 |2 |White |
1 |10 |3 |None |
1 |10 |10 |1000€ |
....
The questionnaire is on a wizard-control and is composed of textboxes,
checkboxlist, radiobuttonlists and other
I have created a small class to handle the saving of data. When loading
wizard page I tell the handler class (handlerObj) the webcontrols and
the question id the control answers to.
ie. handlerObj.add(FirstQuestion, 1)
Saving the data is not a problem. I just loop the controls marked in
handlerObj and save them to the database. Problem is how to load an
unfinished questionnaire to the user to edit?
If my handlerobj has a checkboxlist with questionId 5 and it has 10
listitems to choose from.. When loading, how I set the previously
selected items checked?
All suggestions and ideas to solve this problem are appreciated.
Tuomo
I am having problems with creating an functional questionnaire with
asp.net 2.0 and MSSQL 2005 database.
I have a table with field id (key & auto int), clientId (int),
QuestionId (int), And answer (nvarchar(255)) and a set of questions on
an another table.
Questions can have 0 or more answers
so a client 10 can have the table looking like this
Id|ClientId|QuestionId|Answer|
1 |10 |1 |Yes |
1 |10 |2 |Red |
1 |10 |2 |Blue |
1 |10 |2 |White |
1 |10 |3 |None |
1 |10 |10 |1000€ |
....
The questionnaire is on a wizard-control and is composed of textboxes,
checkboxlist, radiobuttonlists and other
I have created a small class to handle the saving of data. When loading
wizard page I tell the handler class (handlerObj) the webcontrols and
the question id the control answers to.
ie. handlerObj.add(FirstQuestion, 1)
Saving the data is not a problem. I just loop the controls marked in
handlerObj and save them to the database. Problem is how to load an
unfinished questionnaire to the user to edit?
If my handlerobj has a checkboxlist with questionId 5 and it has 10
listitems to choose from.. When loading, how I set the previously
selected items checked?
All suggestions and ideas to solve this problem are appreciated.
Tuomo