Multiple data-table display in data control

Discussion in 'ASP .Net' started by =?Utf-8?B?VHJpbGxpdW0=?=, Apr 20, 2005.

  1. I have an application with a list of questions, which are associated with
    answers by a questId in a one-to-one relationship. The questions may come
    from an XML file or a SQL Server database. The answers data will always come
    from a SQL Server database. I am trying to use a DataList (preferably) or
    Repeater to display the questions and update the answers.

    I am using .Net 1.1. I have created a DataSet with separate tables for
    questions and answers, and explicitly created the QuestAnswer relationship.
    I have data-bound the DataList to the DataSet (not the individual tables).
    The question detail displays, but the answers error out with no-such-column.

    I have found the hierarchical-nested-DataList solution, but it seems
    needlessly complex for a one-to-one relationship. Since the questions and
    answers may come from different sources, I do not want to combine them.

    Can anyone recommend a simple way to get both tables in the DataSet to
    display in my data control? Or what am I missing?
    =?Utf-8?B?VHJpbGxpdW0=?=, Apr 20, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?VHJpbGxpdW0=?=

    Brock Allen Guest

    The DataSet can't do implict joins, so there's no way to have it return you
    a single table with the join. You'd have to do that back in your database
    and load those results into a single table. The other thing is that you can
    manually navigate the relationships via DataRow.GetChildRows (but it sounds
    like you've been doing this).

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I have an application with a list of questions, which are associated
    > with answers by a questId in a one-to-one relationship. The questions
    > may come from an XML file or a SQL Server database. The answers data
    > will always come from a SQL Server database. I am trying to use a
    > DataList (preferably) or Repeater to display the questions and update
    > the answers.
    >
    > I am using .Net 1.1. I have created a DataSet with separate tables
    > for questions and answers, and explicitly created the QuestAnswer
    > relationship. I have data-bound the DataList to the DataSet (not the
    > individual tables). The question detail displays, but the answers
    > error out with no-such-column.
    >
    > I have found the hierarchical-nested-DataList solution, but it seems
    > needlessly complex for a one-to-one relationship. Since the questions
    > and answers may come from different sources, I do not want to combine
    > them.
    >
    > Can anyone recommend a simple way to get both tables in the DataSet to
    > display in my data control? Or what am I missing?
    >
    Brock Allen, Apr 21, 2005
    #2
    1. Advertising

  3. I was afraid of that. I was hoping to be able to keep the questions part in
    an XML file, but if I have to load it into the database to make this work
    I'll do that.

    Alternatively, do you think it would be more difficult would it be to
    retrieve the answer data from the database into an XML document and merge it
    with the questions XML? (I am still trying to figure out the best ways to do
    things in .NET.)

    "Brock Allen" wrote:

    > The DataSet can't do implict joins, so there's no way to have it return you
    > a single table with the join. You'd have to do that back in your database
    > and load those results into a single table. The other thing is that you can
    > manually navigate the relationships via DataRow.GetChildRows (but it sounds
    > like you've been doing this).
    >
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
    > > I have an application with a list of questions, which are associated
    > > with answers by a questId in a one-to-one relationship. The questions
    > > may come from an XML file or a SQL Server database. The answers data
    > > will always come from a SQL Server database. I am trying to use a
    > > DataList (preferably) or Repeater to display the questions and update
    > > the answers.
    > >
    > > I am using .Net 1.1. I have created a DataSet with separate tables
    > > for questions and answers, and explicitly created the QuestAnswer
    > > relationship. I have data-bound the DataList to the DataSet (not the
    > > individual tables). The question detail displays, but the answers
    > > error out with no-such-column.
    > >
    > > I have found the hierarchical-nested-DataList solution, but it seems
    > > needlessly complex for a one-to-one relationship. Since the questions
    > > and answers may come from different sources, I do not want to combine
    > > them.
    > >
    > > Can anyone recommend a simple way to get both tables in the DataSet to
    > > display in my data control? Or what am I missing?
    > >

    >
    >
    >
    >
    =?Utf-8?B?VHJpbGxpdW0=?=, Apr 21, 2005
    #3
    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. Rio
    Replies:
    4
    Views:
    1,188
  2. Jam Pa
    Replies:
    3
    Views:
    464
    Spartanicus
    Apr 28, 2005
  3. Geary
    Replies:
    2
    Views:
    720
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 12, 2007
  4. Ralph
    Replies:
    6
    Views:
    887
    Ed Murphy
    Sep 1, 2009
  5. cp
    Replies:
    3
    Views:
    207
    Jason
    Dec 24, 2004
Loading...

Share This Page