Programming loops inside repeater controls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chumley the Walrus

    #1

    Programming loops inside repeater controls

    I'm trying to display groups of records with the repeater control in a
    loop, whereas each time i iterate i will display the next set of
    displaygroups. My sql,databind strings are :

    <script language="VB" runat="server">
    Sub Page_Load(Src As Object, E As EventArgs)
    Dim strConn as string
    ="Provider=SQLO LEDB;SERVER=xxx .xx.xx.xxx;UID= sa;PWD=xxxxx;DA TABASE=productc at;"
    Dim strSQL as string ="select * from category where displaygroup = d"
    Dim Conn as New OLEDBConnection (strConn)
    Dim Cmd as New OLEDBCommand(st rSQL,Conn)
    Conn.Open()
    thedata.DataSou rce =
    Cmd.ExecuteRead er(system.data. CommandBehavior .CloseConnectio n)
    thedata.DataBin d()
    End Sub
    </script>


    I'm trying to loop thru the database until i run out of records:

    <ASP:Repeater id="thedata" runat="server">
    <itemtemplate>< %dim d
    d= 1
    if thedata.databin d() not eof then
    d = d +1
    end if
    %>
    <%# Container.DataI tem("CName")%>

    </ItemTemplate>
    </ASP:Repeater>


    ...getting "Expression does not produce a value" error. The
    thedata.databin d() method is where i'm having problems
  • Marina

    #2
    Re: Programming loops inside repeater controls

    I think the problem is that 'if thedata.databin d not eof then' is not a
    valid if test. Meaning, that the conditions doesn't evaluate to true/false -
    in fact, I'm not sure what the meaning of that is. The 'not' operator works
    on single operands, to negate a boolean - it has no meaning with 2 operands.

    "Chumley the Walrus" <springb2k@yaho o.com> wrote in message
    news:1ef65641.0 405110941.637d3 407@posting.goo gle.com...[color=blue]
    > I'm trying to display groups of records with the repeater control in a
    > loop, whereas each time i iterate i will display the next set of
    > displaygroups. My sql,databind strings are :
    >
    > <script language="VB" runat="server">
    > Sub Page_Load(Src As Object, E As EventArgs)
    > Dim strConn as string
    >[/color]
    ="Provider=SQLO LEDB;SERVER=xxx .xx.xx.xxx;UID= sa;PWD=xxxxx;DA TABASE=productc a
    t;"[color=blue]
    > Dim strSQL as string ="select * from category where displaygroup = d"
    > Dim Conn as New OLEDBConnection (strConn)
    > Dim Cmd as New OLEDBCommand(st rSQL,Conn)
    > Conn.Open()
    > thedata.DataSou rce =
    > Cmd.ExecuteRead er(system.data. CommandBehavior .CloseConnectio n)
    > thedata.DataBin d()
    > End Sub
    > </script>
    >
    >
    > I'm trying to loop thru the database until i run out of records:
    >
    > <ASP:Repeater id="thedata" runat="server">
    > <itemtemplate>< %dim d
    > d= 1
    > if thedata.databin d() not eof then
    > d = d +1
    > end if
    > %>
    > <%# Container.DataI tem("CName")%>
    >
    > </ItemTemplate>
    > </ASP:Repeater>
    >
    >
    > ..getting "Expression does not produce a value" error. The
    > thedata.databin d() method is where i'm having problems[/color]


    Comment

    Working...