Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Multiple data-table display in data control

Reply
Thread Tools

Multiple data-table display in data control

 
 
=?Utf-8?B?VHJpbGxpdW0=?=
Guest
Posts: n/a
 
      04-20-2005
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?

 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      04-21-2005
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?
>




 
Reply With Quote
 
 
 
 
=?Utf-8?B?VHJpbGxpdW0=?=
Guest
Posts: n/a
 
      04-21-2005
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?
> >

>
>
>
>

 
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
Display Multiple Sets Of Data In THe Same Datagrid Iain Wilson ASP .Net 1 04-17-2008 08:39 AM
choosing to display or not to display a checkbox in repeater control. Imran Aziz ASP .Net 4 08-11-2005 05:00 PM
multiple validators on textfield w/display=dynamic don't display correctly cp ASP .Net Web Controls 3 12-24-2004 03:24 PM
Odd web control problem. Two instances of control A on different pages display each other's data! ~~~ .NET Ed ~~~ ASP .Net Building Controls 2 11-24-2004 11:38 PM
Display 1 data row as multiple datagrid rows Craig Banks ASP .Net 1 02-20-2004 11:07 PM



Advertisments