C
Chumley the Walrus
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=SQLOLEDB;SERVER=xxx.xx.xx.xxx;UID=sa;PWD=xxxxx;DATABASE=productcat;"
Dim strSQL as string ="select * from category where displaygroup = d"
Dim Conn as New OLEDBConnection(strConn)
Dim Cmd as New OLEDBCommand(strSQL,Conn)
Conn.Open()
thedata.DataSource =
Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
thedata.DataBind()
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.databind() not eof then
d = d +1
end if
%>
<%# Container.DataItem("CName")%>
</ItemTemplate>
</ASP:Repeater>
...getting "Expression does not produce a value" error. The
thedata.databind() method is where i'm having problems
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=SQLOLEDB;SERVER=xxx.xx.xx.xxx;UID=sa;PWD=xxxxx;DATABASE=productcat;"
Dim strSQL as string ="select * from category where displaygroup = d"
Dim Conn as New OLEDBConnection(strConn)
Dim Cmd as New OLEDBCommand(strSQL,Conn)
Conn.Open()
thedata.DataSource =
Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
thedata.DataBind()
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.databind() not eof then
d = d +1
end if
%>
<%# Container.DataItem("CName")%>
</ItemTemplate>
</ASP:Repeater>
...getting "Expression does not produce a value" error. The
thedata.databind() method is where i'm having problems