Hi ,
i am designing QuestionCreation form using asp.net(C#) which consists
4 fields(Question,Qtype(single/multiple),options,answer). these 4
fileds should be saved into 3 sql
tables(Quetion,Answer,Answer_Details). The fields for these tables
are:
Quetion(idquetion,QName,Qtype,idAnswer)
Answer(idAnswer,Answer)
Answer_Details(idAnswerDetail,idAnswer,Options)
for this i had written the following Querry:
use questionbank
create table Question
(idquestion int identity(1,1) primary key,
Qname varchar(MAX) not null,
Qtype varchar(20) not null,
idAnswer int
)
create table Answer
(idAnswer int references Question(idAnswer) on update cascade on
delete cascade,
Answer varchar(50) not null,
)
create table Answer_Detail
(idAnswerDetail int identity(1,1)primary key,
idAnswer int references Question(idAnswer) on update cascade on delete
cascade,
options varchar(50)
)
here i struck with problem.
” i want to set identity property for idAnswer in Answer and
Answer_Detail table. if i do so, i get an error, what can i do. here i
want, all the 3 idAnswers should be automatically incremented equally
during submitting QuetionCreation form.”.
and also i had one add option on my form, which adds one text box on
each click. how can i store these dynamically generated options into
my Answer_Detail table.