Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Newbie: Datagrid with 2 tables

Reply
Thread Tools

Newbie: Datagrid with 2 tables

 
 
^^@++
Guest
Posts: n/a
 
      05-19-2004
Hi guys,
I'm still having trouble with my questionnaire web site. Anyone know
of a questionnaire code example anywhere?

To start with I'll have 2 tables - Questions and Answers.

Questions = QuestionID, QuestionNumber, QuestionText, Answers
1 1 What's your name? null
2 1a, Sex
Male/Female
3 1b Age
0-20/20-30/30+


Answers = QuestionID, UserID, Answer
1 37 Matt F
2 37 Male
3 37 20-30
1 38 Steve
...


So, my web page needs to read the questions from the DB, display them,
and then write the answers to the answer table. Sounds simple to me.

In the Questions table, when the Answers field is null, a Textbox
needs to be displayed for their answer. When Answer is not null, I'll
display a DropDownList with the available answers.

So, my questions.

1. Is this possible with a DataRepeater or DataGrid? (Bear in mind my
DropDownList requirement)
2. Is the correct approach to fill a DataSet with the rows from the
Question table and bind that to a DataGrid? Then have a submit button,
which when clicked creates an Answers DataSet which is merged in?

Hopefully I've got this right, but I can't find any code which does
what I've described which leads me to question my approach. I have
Esposito's ASP.NET but the examples in there all seem to be displaying
and updating data from one table.

Thanks for any advice
-Matt
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get database metadata information (i.e. existing tables and columns in tables) Chris Brat Python 5 08-22-2006 05:25 PM
Tables within tables Otuatail HTML 7 08-02-2004 04:42 AM
Datagrid or Datalist with Lookup Tables Demetri ASP .Net 0 10-15-2003 01:26 AM
Text after 2 tables actually appears between 2 tables ! Peter Bassett HTML 3 08-15-2003 06:46 PM
Re: Datagrid based on two tables David Wier ASP .Net 0 08-05-2003 04:46 PM



Advertisments