SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Repeater Help

  1. #1
    SitePoint Enthusiast dlh1989's Avatar
    Join Date
    Nov 2004
    Location
    Sunshine Coast, QLD, Australia
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Repeater Help

    I am very new to ASP.NET and am in need of some help. I am having some problems with the asp:repeater. I'm not going to give out the complete content of my database but basically this is what the query returns ("Friday", "Line 1"), ("Saturday", "Line 2"), ("Saturday", "Line 3"), etc.

    Basically, what I want is this:

    Friday
    Line 1

    Saturday
    Line 2
    Line 3
    Line 4
    Line 5

    Sunday
    Line 6
    Line 7
    Line 8.

    Now in ASP this is simple but how do I do this in VB.NET?
    So far I have this:
    Code:
    <script runat="server">
    sub Page_Load
    Dim strSQL As String = "SELECT * FROM ..."
    dim strConn as string = "driver={MySQL ODBC 3.51 Driver};..."
    dim myConn as new ODBCConnection(strConn)
    myConn.Open()
    dim Cmd As New OdbcDataAdapter(strSQL, myConn)
    Dim ds = New DataSet
    Cmd.Fill(ds)
    nextweekdates.DataSource = ds
    nextweekdates.DataBind()
    endsub
    </script>
    and
    Code:
    <asp:Repeater id="nextweekdates" runat="server">
     
    <headertemplate>
    <table>
    </headertemplate>
     
    <itemtemplate>
    <tr>
    <td colspan="2" class="green2" align="left">
    <&#37;# Container.DataItem("Day")%>
    </td>
    </tr>
    </itemtemplate>
     
    <footertemplate>
    </table>
    </footertemplate>
     
    </asp:Repeater>
    This returns:

    Friday
    Saturday
    Saturday
    Saturday
    Saturday
    Sunday
    Sunday
    Sunday

    but this isnt exactly what I want. I have found various tutorials but i can't quite underdstand them. Can someone please simplify this for me?
    Daniel H

    The greatest Australian Football fansite around...
    www.TheForward50.com

  2. #2
    SitePoint Enthusiast dlh1989's Avatar
    Join Date
    Nov 2004
    Location
    Sunshine Coast, QLD, Australia
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are people not responding because they don't know how to do it or are people not responding because it cannot be explained simply? All I want is to be able to group results by day and display each day's results under the heading of that day.
    Daniel H

    The greatest Australian Football fansite around...
    www.TheForward50.com

  3. #3
    SitePoint Wizard
    Join Date
    Feb 2007
    Posts
    1,274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •