Karl;
I did as you suggested but used a nested Repeater as follows:
<asp:Repeater ID="clubRep1" Runat="server">
<HeaderTemplate>
<table><tr><td>
</HeaderTemplate>
<ItemTemplate>
<asp:Repeater ID="clubRep2" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>'
Runat="server">
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# (DataBinder.Eval(Container.DataItem,
"[\"SectionDTitle\"]"))%></td>
</tr>
<tr>
<td>
<asp:Repeater DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
Runat="server">
<ItemTemplate>
<img src='<%# "Sonar3/UploadImg/" +
DataBinder.Eval(Container.DataItem, "[\"ImgName\"]") +
DataBinder.Eval(Container.DataItem, "[\"imgType\"]")%>' />
</ItemTemplate>
</asp:Repeater>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</ItemTemplate>
<FooterTemplate>
</td></tr></table>
</FooterTemplate>
</asp:Repeater>
I recieved an error as follows on the third repeater:
"Specified cast is not valid. "
Any Suggestions?
"Karl Seguin" wrote:
Sam:
can't you just add a 2nd relationship:
dsClub.Relations.Add("Data_Image", dsClub.Tables["SData"].Columns["sdID"],
dsClub.Tables["img_tbl"].Columns["sdID"]);
then when you have a row in Section, you can call
GetChildRows("Section_Data")
which will return all the Child rows...and then you can take one of those
and call GetChildRows("Data_Image") to return the grandchildren rows
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:94**********************************@microsof t.com... I can relate two tables rather easily using the following code:
dsClub.Relations.Add("Section_Data",
dsClub.Tables["Section"].Columns["SectionID"],
dsClub.Tables["SData"].Columns["SectionID"]);
Which connects the "Section" table to the "SData" table rather easily
using the "SectionID" primary key. My question is:
I need to connect an "img_tbl" table to the "SData" table that is
constrained by the "Section" table so that the rows returned in the
"SData" table constrain the "img_tble"; ie, Parent/Child/Grandchild relationship.
The tables "SData" and "img_tbl" have their own Primary/Foreign key to
connect them together called "sdID" How do I set the the Grandchild
relationship between the two?