Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Nested Repeater

Reply
Thread Tools

Nested Repeater

 
 
DE_Kabal
Guest
Posts: n/a
 
      09-07-2006
I relatively new to ASP.Net, coming from a ColdFusion background. I'm trying
to create a report that does the following in a table:

Organization1
url pass failed
url pass failed
url pass failed
Organization2
url pass failed
url pass failed
url pass failed

I tried using 2 SQLDataSources and could only get one organization then all
the other data not sorted. I then tried the MicroSoft example, with some
variation, and that didn't work. The result above comes from a single table.
Here is the code I am using from the MS example:

<asp:Repeater ID="parentRepeater" runat="server">
<HeaderTemplate>
<table border="1" cellpadding="3" cellspacing="0" summary="this table
for layout">
<tr>
<td scope="col">Agency</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<strong><%# DataBinder.Eval(Container.DataItem, "agency")
%></strong>
</td>
<asp:Repeater ID="childRepeater" runat="server"
DataSource='<%#
Container.DataItem.Row.GetChildRows("myrelation") %>'>
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "url") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "filespass")
%></td>
<td><%# DataBinder.Eval(Container.DataItem, "filesfailed")
%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tr>
</ItemTemplate>
</asp:Repeater>

Codebehind
Dim strConn1 As String =
ConfigurationManager.ConnectionStrings("accmon").C onnectionString
Dim MySQL1 As String = "SELECT DISTINCT agency FROM websites WHERE
webDelete = 0 AND webNew = 0"
Dim MyConn1 As New OleDbConnection(strConn1)
Dim cmd1 As New OleDbDataAdapter(MySQL1, MyConn1)
Dim ds As DataSet = New DataSet()
cmd1.Fill(ds, "websites")

'Create table for child repeater
Dim MySQL2 As String = "SELECT webID, url, files508, pass508,
failed508, verify508 FROM websites " & _
"WHERE webDelete = 0 AND webNew = 0"
Dim cmd2 As New OleDbDataAdapter(MySQL2, MyConn1)
cmd2.Fill(ds, "weburl")
ds.Relations.Add("myrelation", _
ds.Tables("websites").Columns("agency"), _
ds.Tables("weburl").Columns("url"))
parentRepeater.DataSource = ds.Tables("websites")
Page.DataBind()
MyConn1.Close()
--
cheers;
DE_Kabal
 
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
repeater inside a repeater problem. uncensored ASP .Net 0 10-25-2006 06:10 PM
Repeater inside a Repeater Microsoft ASP .Net Web Controls 0 08-21-2006 09:13 AM
Repeater inside a repeater....how? voidfill3d@yahoo.com ASP .Net 1 08-10-2005 01:58 PM
Repeater Using Javascript Referencing a Column in the Repeater rwoo_98@yahoo.com ASP .Net 0 02-26-2005 05:02 PM
Repeater control with nested repeater chris.reed@digus.com ASP .Net 0 02-11-2005 05:10 PM



Advertisments