[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Nested Repeater in ASP.NET

Posted on 2009-04-15
18
Medium Priority
?
550 Views
Last Modified: 2012-06-27
The current table of contents for this journal page has columns Title, Authored By, Section, and Page #. I am populating this table with a repeater, and the code-behind is written in ASP.NET. My problem is simple - I need to split this table up by section and make the section name the title for each table. Each journal may have different sections, so the section titles need to be dynamic.

I got the HTML part to work (I think), but I am now getting an error in the code-behind. It says 'column' argument cannot be null. The error is on the line where I do:

ds.Relations.Add("myrelation", ds.Tables("Sections").Columns("titleId"), ds.Tables("TOC").Columns("titleId")).

I'm not really sure what this line of code is doing. I copied it from http://support.microsoft.com/kb/306154. Do I have the right information in the columns argument?
'ON SHOWTITLE.ASPX.VB
'Create the connection and DataAdapter for the Authors table.
                Dim connString As String = Connection.getConnString
                Dim cnn As New SqlConnection
                cnn = New SqlConnection(connString)
                Dim cmd1 As New SqlDataAdapter("SELECT _Title.title AS title, _Section.name AS sectionName, _Title.titleId AS titleId, _Article.articleId, _Article.issueId, _Article.sectionId, _Article.page FROM _Article INNER JOIN _Section ON _Article.sectionId = _Section.sectionId INNER JOIN _Title ON _Article.titleIdFk = _Title.titleId WHERE (_Article.issueId = 167) ORDER BY _Article.sectionId, _Article.page", cnn)
 
                'Create and fill the DataSet.
                Dim ds As New DataSet()
                cmd1.Fill(ds, "sections")
 
                'Create a second DataAdapter for the Titles table.
                Dim cmd2 As New SqlDataAdapter("SELECT DISTINCT _Section.name AS sectionName FROM _Article INNER JOIN _Section ON _Article.sectionid = _Section.sectionId INNER JOIN _Title ON _Article.titleidfk = _Title.titleId WHERE(_Article.issueid = 167) ORDER BY sectionName", cnn)
                cmd2.Fill(ds, "TOC")
 
                'Create the relation bewtween the Sections and TOC tables.
                ds.Relations.Add("myrelation", ds.Tables("Sections").Columns("titleId"), ds.Tables("TOC").Columns("titleId"))
 
                'Bind the Authors table to the parent Repeater control, and call DataBind.
                parentRepeater.DataSource = ds.Tables("sections")
                Page.DataBind()
 
                cnn.Close()
 
 
 
<%--ON SHOWTITLE.ASPX--%>
        <div style="padding-bottom:25px;">
            <asp:Repeater ID="parentRepeater" runat="server">
                <ItemTemplate>
                    <b>
                        <%#DataBinder.Eval(Container.DataItem, "sectionName")%>
                    </b>
                    <br>
                    <asp:Repeater ID="child" DataSource='<%# DirectCast(Container.DataItem, System.Data.DataRowView).Row.GetChildRows("myrelation") %>'
                        runat="server">
                        <ItemTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'><%# Container.DataItem("title") %></a>
                                    </td>
                                    <td align="center">
                                        <%#Container.DataItem("people")%>
                                    </td>
                                    <td align="center">
                                        <%#Container.DataItem("page")%>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:Repeater>
                </ItemTemplate>
            </asp:Repeater>
        </div>

Open in new window

table-of-contents.jpg
table-of-contents-2.jpg
0
Comment
Question by:BYU-Studies
  • 10
  • 8
18 Comments
 
LVL 3

Expert Comment

by:rbradberry
ID: 24152873
I answered this in your last post.

your second SQL statement (cmd2) needs to return the column "titleId".  you can't make a relation to a column that isn't there
0
 

Author Comment

by:BYU-Studies
ID: 24153308
Great. I am getting the results on the page without any errors. My last problem is that I have multiple of the same section heading and only 1 row per heading. I need to group the results by section. How do I do that?
'Create the connection and DataAdapter for the Authors table.
                Dim connString As String = Connection.getConnString
                Dim cnn As New SqlConnection
                cnn = New SqlConnection(connString)
                Dim cmd1 As New SqlDataAdapter("SELECT DISTINCT _Section.name AS sectionName, _Title.title AS title, _Title.titleId AS titleId, _Article.page AS page FROM _Article INNER JOIN _Section ON _Article.sectionid = _Section.sectionId INNER JOIN _Title ON _Article.titleidfk = _Title.titleId WHERE(_Article.issueid = 167) ORDER BY sectionName", cnn)
 
                'Create and fill the DataSet.
                Dim ds As New DataSet()
                cmd1.Fill(ds, "sections")
 
                'Create a second DataAdapter for the Titles table.
                Dim cmd2 As New SqlDataAdapter("SELECT _Title.title AS title, _Section.name AS sectionName, _Title.titleId AS titleId, _Article.articleId, _Article.issueId, _Article.sectionId, _Article.page FROM _Article INNER JOIN _Section ON _Article.sectionId = _Section.sectionId INNER JOIN _Title ON _Article.titleIdFk = _Title.titleId WHERE (_Article.issueId = 167) ORDER BY _Article.sectionId, _Article.page", cnn)
                cmd2.Fill(ds, "TOC")
                ds.Tables("TOC").Columns.Add("people", GetType(String))
                Dim TOCRow As DataRow
                For Each TOCRow In ds.Tables("TOC").Rows
                    Dim aTitle As New Title
                    aTitle.load(TOCRow("titleid"))
                    TOCRow("people") = aTitle.getPeopleString
                    aTitle.dispose()
                Next
 
                'Create the relation bewtween the Sections and TOC tables.
                ds.Relations.Add("myrelation", ds.Tables("Sections").Columns("titleId"), ds.Tables("TOC").Columns("titleId"))
 
                'Bind the Authors table to the parent Repeater control, and call DataBind.
                parentRepeater.DataSource = ds.Tables("sections")
                Page.DataBind()
 
                cnn.Close()
 
 
 
 
 
<%--ON SHOWTITLE.ASPX--%>
        <div style="padding-bottom: 25px;">
            <asp:Repeater ID="parentRepeater" runat="server">
                <ItemTemplate>
                    <b>
                        <%#DataBinder.Eval(Container.DataItem, "sectionName")%>
                    </b>
                    <br>
                    <asp:Repeater ID="child" DataSource='<%# DirectCast(Container.DataItem, System.Data.DataRowView).Row.GetChildRows("myrelation") %>'
                        runat="server">
                        <HeaderTemplate>
                            <table width="720px" border="0" cellpadding="3">
                                <tr bgcolor="#dddddd">
                                    <td align="center">
                                        <b>Title</b>
                                    </td>
                                    <td align="center" width="200px">
                                        <b>Authored By</b>
                                    </td>
                                    <td align="center" width="50px">
                                        <b>Page #</b>
                                    </td>
                                </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr bgcolor="#dddddd">
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td width="200px" align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td width="50px" align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </ItemTemplate>
            </asp:Repeater>
        </div>

Open in new window

table-of-contents-3.jpg
0
 
LVL 3

Expert Comment

by:rbradberry
ID: 24153441
your code displaying the section name as well as the code displaying "title", "authored by" and "page #" should all be in the HeaderTemplate of the Parent Repeater
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:BYU-Studies
ID: 24159753
I did that, and I lost all of the section headings. I'm wondering if the parent repeater is working at all. What am I doing wrong? Do you think it's in the HTML, or could it be in the code-behind?
<%--ON SHOWTITLE.ASPX--%>
        <div style="padding-bottom: 25px;">
            <asp:Repeater ID="parentRepeater" runat="server">
                <HeaderTemplate>
                    <b>
                        <%#DataBinder.Eval(Container.DataItem, "sectionName")%>
                    </b>
                    <br>
                    <table width="720px" border="0" cellpadding="3">
                        <tr bgcolor="#dddddd">
                            <td align="center">
                                <b>Title</b>
                            </td>
                            <td align="center" width="200px">
                                <b>Authored By</b>
                            </td>
                            <td align="center" width="50px">
                                <b>Page #</b>
                            </td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Repeater ID="child" DataSource='<%# DirectCast(Container.DataItem, System.Data.DataRowView).Row.GetChildRows("myrelation") %>'
                        runat="server">
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr bgcolor="#dddddd">
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td width="200px" align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td width="50px" align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                    </asp:Repeater>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>

Open in new window

table-of-contents-4.jpg
0
 
LVL 3

Expert Comment

by:rbradberry
ID: 24159967
try putting the parentRepeater header template into the childRepeater header template
0
 

Author Comment

by:BYU-Studies
ID: 24160875
That's kind of like what I had before, but it's still not displaying the section headers. Here's what I'm getting:
<%--ON SHOWTITLE.ASPX--%>
        <div style="padding-bottom: 25px;">
            <asp:Repeater ID="parentRepeater" runat="server">
                <ItemTemplate>
                    <asp:Repeater ID="child" DataSource='<%# DirectCast(Container.DataItem, System.Data.DataRowView).Row.GetChildRows("myrelation") %>'
                        runat="server">
                        <HeaderTemplate>
                            <b>
                                <%#DataBinder.Eval(Container.DataItem, "sectionName")%>
                            </b>
                            <br>
                            <table width="720px" border="0" cellpadding="3">
                                <tr bgcolor="#dddddd">
                                    <td align="center">
                                        <b>Title</b>
                                    </td>
                                    <td align="center" width="200px">
                                        <b>Authored By</b>
                                    </td>
                                    <td align="center" width="50px">
                                        <b>Page #</b>
                                    </td>
                                </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr bgcolor="#dddddd">
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td width="200px" align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td width="50px" align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                    </asp:Repeater>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>

Open in new window

table-of-contents-5.jpg
0
 
LVL 3

Expert Comment

by:rbradberry
ID: 24160913
so it seems the header is supposed to be in the parent repeater.
check to be sure that your parent dataset is returning one row per section

also, if you can post what the return data looks like for both datasets, that will also be helpful
0
 

Author Comment

by:BYU-Studies
ID: 24161935
How do I check if my parent dataset is returning one row per section? Here's the return data for both datasets.
sections-dataset.jpg
TOC-dataset.jpg
0
 
LVL 3

Expert Comment

by:rbradberry
ID: 24162158
ok, your problem is that your parent dataset is returning too many records.  instead of creating the relationship on titleId create the relationship on sectionId.  in that SQL Query you want to only return sectionName and sectionID, maybe something like this:

SELECT DISTINCT name AS sectionName, Id AS sectionId FROM _Section

Then the child select statement might look something like this:

SELECT _Title.title AS title, _Title.sectionID as titleSectionId, _Title.titleId AS titleId, _Article.articleId, _Article.issueId, _Article.sectionId, _Article.page FROM _Article INNER JOIN _Title ON _Article.titleIdFk = _Title.titleId WHERE (_Article.issueId = 167) ORDER BY _Article.sectionId, _Article.page

then your relationship might be something like:
ds.Relations.Add("myrelation", ds.Tables("Sections").Columns("sectionID"), ds.Tables("TOC").Columns("titleSectionID"))

with each data set you only want to return the columns you require.  the relationship is based on the sectionID not the titleID.  This is why it repeats itself, because your parent dataset is returning a record for every title when you want it to return a record for every section.
0
 

Author Comment

by:BYU-Studies
ID: 24171333
I see what you're saying. There's still a problem with the second SQL statement because sectionId is not in the title table, so it gave a compilation error. I attached a picture of the class diagram for these tables to show the relationships.

I tried changing the SQL to:
SELECT     _Title.title, _Article.sectionid, _Title.titleId, _Article.articleid, _Article.issueid, _Article.sectionid AS Expr1, _Article.page
FROM         _Title INNER JOIN
                      _Article ON _Title.titleId = _Article.titleidfk INNER JOIN
                      _Section ON _Article.sectionid = _Section.sectionId
WHERE     (_Article.issueid = 167)
ORDER BY _Article.sectionid, _Article.page

and then I changed the relationship to:
ds.Relations.Add("myrelation", ds.Tables("Sections").Columns("sectionID"), ds.Tables("TOC").Columns("sectionID"))

and it came out like the picture shown. Any ideas?


DatabaseDiagram.jpg
table-of-contents-6.jpg
0
 
LVL 3

Expert Comment

by:rbradberry
ID: 24171444
did you put the headertemplate back into the parent repeater?
0
 

Author Comment

by:BYU-Studies
ID: 24172338
No, I didn't put the headertemplate back into the parent repeater. I just did that, but the section titles still do not appear. In fact, I can put whatever I want in place of "sectionName" in the headertemplate in the parent repeater and it doesn't do anything. It doesn't throw any errors and it doesn't change the output. However, if I do anything to the Title, Authored By, Section, Page # part, I see changes. Here's the current code and output.

I included the sectionName column back into the table to make it easy to see where the divisions should take place. I find it interesting that one of the rows toward the bottom doesn't alternate colors.
<%--ON SHOWTITLE.ASPX--%>
        <div style="padding-bottom: 25px;">
            <asp:Repeater ID="parentRepeater" runat="server">
                <HeaderTemplate>
                    <b>
                        <%#DataBinder.Eval(Container.DataItem, "sectionName")%>
                    </b>
                    <br>
                    <table width="720px" border="0" cellpadding="3">
                        <tr bgcolor="#dddddd">
                            <td align="center">
                                <b>Title</b>
                            </td>
                            <td align="center" width="200px">
                                <b>Authored By</b>
                            </td>
                            <td align="center" width="100px">
                                <b>Section</b>
                            </td>
                            <td align="center" width="50px">
                                <b>Page #</b>
                            </td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Repeater ID="child" DataSource='<%# DirectCast(Container.DataItem, System.Data.DataRowView).Row.GetChildRows("myrelation") %>'
                        runat="server">
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("sectionName")%>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr bgcolor="#dddddd">
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td width="200px" align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("sectionName")%>
                                </td>
                                <td width="50px" align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                    </asp:Repeater>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>
 
 
 
'ON SHOWTITLE.ASPX.VB
'Create the connection and DataAdapter for the Authors table.
                Dim connString As String = Connection.getConnString
                Dim cnn As New SqlConnection
                cnn = New SqlConnection(connString)
                Dim cmd1 As New SqlDataAdapter("SELECT DISTINCT name AS sectionName, sectionId AS sectionId FROM _Section ORDER BY sectionName", cnn)
 
                'Create and fill the DataSet.
                Dim ds As New DataSet()
                cmd1.Fill(ds, "sections")
 
                'Create a second DataAdapter for the Titles table.
                Dim cmd2 As New SqlDataAdapter("SELECT _Title.title, _section.name as sectionName, _Article.sectionid, _Title.titleId, _Article.articleid, _Article.issueid, _Article.sectionid AS Expr1, _Article.page FROM _Title INNER JOIN _Article ON _Title.titleId = _Article.titleidfk INNER JOIN _Section ON _Article.sectionid = _Section.sectionId WHERE(_Article.issueid = 167) ORDER BY _section.sectionName", cnn)
                cmd2.Fill(ds, "TOC")
                ds.Tables("TOC").Columns.Add("people", GetType(String))
                Dim TOCRow As DataRow
                For Each TOCRow In ds.Tables("TOC").Rows
                    Dim aTitle As New Title
                    aTitle.load(TOCRow("titleid"))
                    TOCRow("people") = aTitle.getPeopleString
                    aTitle.dispose()
                Next
 
                'Create the relation bewtween the Sections and TOC tables.
                ds.Relations.Add("myrelation", ds.Tables("Sections").Columns("sectionID"), ds.Tables("TOC").Columns("sectionID"))
 
                'Bind the Authors table to the parent Repeater control, and call DataBind.
                parentRepeater.DataSource = ds.Tables("sections")
                Page.DataBind()
 
                cnn.Close()

Open in new window

table-of-contents-7.jpg
0
 
LVL 3

Expert Comment

by:rbradberry
ID: 24172464
my apologies, the reason it is not showing is that there is no data when the header is initialized.  try putting the header information in the itemtemplate of the parent repeater.  i dont mean to run you around, im am just trying to help while troubleshooting other stuff at work. haha
0
 

Author Comment

by:BYU-Studies
ID: 24206832
Thanks. It's so close to working now, but the section headers are off by 1.
<%--ON SHOWTITLE.ASPX--%>
        <div style="padding-bottom: 25px;">
            <asp:Repeater ID="parentRepeater" runat="server">
                <ItemTemplate>
                    <br />
                    <b>
                        <%#DataBinder.Eval(Container.DataItem, "sectionName")%>
                    </b>
                    <br>
                    <table width="720px" border="0" cellpadding="3">
                        <tr bgcolor="#dddddd">
                            <td align="center">
                                <b>Title</b>
                            </td>
                            <td align="center" width="200px">
                                <b>Authored By</b>
                            </td>
                            <td align="center" width="100px">
                                <b>Section</b>
                            </td>
                            <td align="center" width="50px">
                                <b>Page #</b>
                            </td>
                        </tr>
                    <asp:Repeater ID="child" DataSource='<%# DirectCast(Container.DataItem, System.Data.DataRowView).Row.GetChildRows("myrelation") %>'
                        runat="server">
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("sectionName")%>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr bgcolor="#dddddd">
                                <td>
                                    <a href='showTitle.aspx?title=<%# Container.DataItem("titleid") %>'>
                                        <%# Container.DataItem("title") %>
                                    </a>
                                </td>
                                <td width="200px" align="center">
                                    <%#Container.DataItem("people")%>
                                </td>
                                <td align="center">
                                    <%#Container.DataItem("sectionName")%>
                                </td>
                                <td width="50px" align="center">
                                    <%#Container.DataItem("page")%>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                    </asp:Repeater>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>

Open in new window

table-of-contents-8.jpg
0
 

Author Comment

by:BYU-Studies
ID: 24206915
I also made a slight change to the 1st SQL query in the code-behind so that it would only get the sections for issueId 167. I'll go back and get it to pull the table of contents for whatever journal the person is actually looking at - I just did that for testing purposes. Just in case you need it, here's the latest code-behind.
'Create the connection and DataAdapter for the Authors table.
                Dim connString As String = Connection.getConnString
                Dim cnn As New SqlConnection
                cnn = New SqlConnection(connString)
                Dim cmd1 As New SqlDataAdapter("SELECT DISTINCT name AS sectionName, _Section.sectionId AS sectionId FROM _Section INNER JOIN _Article ON _Article.sectionId = _Section.sectionId WHERE _Article.issueId = 167 ORDER BY sectionName", cnn)
 
                'Create and fill the DataSet.
                Dim ds As New DataSet()
                cmd1.Fill(ds, "sections")
 
                'Create a second DataAdapter for the Titles table.
                Dim cmd2 As New SqlDataAdapter("SELECT _Title.title, _section.name as sectionName, _Article.sectionid, _Title.titleId, _Article.articleid, _Article.issueid, _Article.sectionid AS Expr1, _Article.page FROM _Title INNER JOIN _Article ON _Title.titleId = _Article.titleidfk INNER JOIN _Section ON _Article.sectionid = _Section.sectionId WHERE(_Article.issueid = 167) ORDER BY _section.sectionName", cnn)
                cmd2.Fill(ds, "TOC")
                ds.Tables("TOC").Columns.Add("people", GetType(String))
                Dim TOCRow As DataRow
                For Each TOCRow In ds.Tables("TOC").Rows
                    Dim aTitle As New Title
                    aTitle.load(TOCRow("titleid"))
                    TOCRow("people") = aTitle.getPeopleString
                    aTitle.dispose()
                Next
 
                'Create the relation bewtween the Sections and TOC tables.
                ds.Relations.Add("myrelation", ds.Tables("Sections").Columns("sectionID"), ds.Tables("TOC").Columns("sectionID"))
 
                'Bind the Authors table to the parent Repeater control, and call DataBind.
                parentRepeater.DataSource = ds.Tables("sections")
                Page.DataBind()
 
                cnn.Close()

Open in new window

0
 

Author Comment

by:BYU-Studies
ID: 24218338
Any ideas? I still haven't figured it out...we're so close.
0
 
LVL 3

Accepted Solution

by:
rbradberry earned 1000 total points
ID: 24218495
I know it's not really a solution, but instead a work-around, but try putting the section name below the child repeater.  im still looking into why the record is off by 1.
0
 

Author Comment

by:BYU-Studies
ID: 24227455
Thanks for all of your help. Your workaround did the trick.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question