473,378 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Loading an unfinished questionnaire from a database

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

Apr 29 '07 #1
2 1454
On Apr 29, 2:34 pm, Vili <enha...@spammia.fiwrote:
Problem is how to load an
unfinished questionnaire to the user to edit?
I think you can either enumerate the controls in the handlerObj and
find one with the questionId 5, or you can call FindControl(<name>)...

Apr 30 '07 #2
I have decided to add control id with the answer to the table

So when reading the questions from the database I just compare the
control id to the value from table.
I think you can either enumerate the controls in the handlerObj and
find one with the questionId 5, or you can call FindControl(<name>)...

Apr 30 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: hp | last post by:
I'm currently developing an online questionnaire system for my dissertation and I have now come across a few problems. I'm developing an online approach recommendation system. The basic feature is...
3
by: Jason A. Thompson | last post by:
Dear Access Gurus, I have a database which I hoped to use to administer questionnaires, or rather that someone who knows nothing about Access could use to administer them. Each q'aire item is on...
1
by: javedna | last post by:
Can PHP help with the following as I have tried in the MYSQL Forums and cant get any help Thanks Nabz ---------------------------------------- Hi I am developing a PHP MYSQL questionnaire...
7
by: javedna | last post by:
Hi guys Ive got a simple problem, im designing an online questionnaire and on submission the coding that I have used to validate whether a user has filled in all the questions is supposed to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.