Newbie: Datagrid with 2 tables

Discussion in 'ASP .Net' started by ^^@++, May 20, 2004.

  1. ^^@++

    ^^@++ Guest

    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
     
    ^^@++, May 20, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. suzy

    newbie: tables/layout

    suzy, Jul 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,015
  2. neverstill

    (newbie) insert into linked tables ?

    neverstill, Dec 13, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    461
    neverstill
    Dec 13, 2003
  3. Peter Bassett
    Replies:
    3
    Views:
    939
    Augustus
    Aug 15, 2003
  4. Otuatail

    Tables within tables

    Otuatail, Jul 31, 2004, in forum: HTML
    Replies:
    7
    Views:
    503
  5. Chris Brat
    Replies:
    5
    Views:
    700
    =?iso-8859-1?q?Luis_M._Gonz=E1lez?=
    Aug 22, 2006
Loading...

Share This Page