Click here to Skip to main content
15,905,238 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: arrays Pin
WartHog0006-Dec-04 14:04
WartHog0006-Dec-04 14:04 
GeneralRe: arrays Pin
Anonymous6-Dec-04 14:08
Anonymous6-Dec-04 14:08 
GeneralRe: arrays Pin
WartHog0006-Dec-04 14:10
WartHog0006-Dec-04 14:10 
GeneralRe: arrays Pin
WartHog0006-Dec-04 14:12
WartHog0006-Dec-04 14:12 
GeneralRe: arrays Pin
Anonymous6-Dec-04 14:18
Anonymous6-Dec-04 14:18 
GeneralRe: arrays Pin
WartHog0006-Dec-04 14:23
WartHog0006-Dec-04 14:23 
GeneralRe: arrays Pin
Anonymous6-Dec-04 14:30
Anonymous6-Dec-04 14:30 
GeneralRe: arrays Pin
WartHog0006-Dec-04 14:33
WartHog0006-Dec-04 14:33 
GeneralRe: arrays Pin
Colin Angus Mackay6-Dec-04 14:03
Colin Angus Mackay6-Dec-04 14:03 
GeneralRe: arrays Pin
Colin Angus Mackay6-Dec-04 14:01
Colin Angus Mackay6-Dec-04 14:01 
GeneralRe: arrays Pin
Anonymous6-Dec-04 14:24
Anonymous6-Dec-04 14:24 
GeneralRe: arrays Pin
WartHog0006-Dec-04 14:28
WartHog0006-Dec-04 14:28 
Generaltext files Pin
WartHog0006-Dec-04 11:12
WartHog0006-Dec-04 11:12 
GeneralRe: text files Pin
Jim Matthews6-Dec-04 11:37
Jim Matthews6-Dec-04 11:37 
GeneralRe: text files Pin
WartHog0006-Dec-04 13:34
WartHog0006-Dec-04 13:34 
GeneralRe: text files Pin
Jim Matthews7-Dec-04 3:23
Jim Matthews7-Dec-04 3:23 
GeneralRe: text files Pin
WartHog0007-Dec-04 9:48
WartHog0007-Dec-04 9:48 
GeneralRe: text files Pin
WartHog0007-Dec-04 11:26
WartHog0007-Dec-04 11:26 
GeneralRe: text files Pin
WartHog0007-Dec-04 12:39
WartHog0007-Dec-04 12:39 
GeneralRe: text files Pin
The Man from U.N.C.L.E.8-Dec-04 3:14
The Man from U.N.C.L.E.8-Dec-04 3:14 
GeneralRe: text files Pin
WartHog0008-Dec-04 4:10
WartHog0008-Dec-04 4:10 
Generalnested repeaters in vb.net Pin
bigtone786-Dec-04 6:42
bigtone786-Dec-04 6:42 
Hi,

I've been tring to get nested repeaters to work in vb.net for a while now and I can't seem to do it. The data doesnt want to bind to the second repeater, or atleast it does bind but doesnt display. Here is the code that im using:

<%@ Import Namespace="System.Data.Odbc" %>
<%@ Import Namespace="System.Data" %>


sub Page_Load
Dim sConnString As String = "Dsn=mysqldb;" & _
"Uid=bigtone78;" & _
"Pwd="
Dim oODBCConnection As New OdbcConnection(sConnString)
Dim myInsertQuery As String = "SELECT * FROM questions"
Dim myOdbcCommand As New OdbcCommand(myInsertQuery)
myOdbcCommand.Connection = oODBCConnection
oODBCConnection.Open()
questions.DataSource= myOdbcCommand.ExecuteReader()
questions.DataBind()

myOdbcCommand.Connection.Close()
oODBCConnection.Close()

end sub

sub questions_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles questions.ItemDataBound
if e.item.itemtype = ListItemType.Item or e.item.ItemType = ListItemType.AlternatingItem then

Dim sConnString2 As String = "Dsn=mysqldb;" & _
"Uid=bigtone78;" & _
"Pwd="
Dim oODBCConnection2 As New OdbcConnection(sConnString2)
Dim SQLstring2 As String = "Select * from options"
Dim myOdbcCommand2 As New OdbcCommand(SQLstring2)
myOdbcCommand2.Connection = oODBCConnection2
oODBCConnection2.Open()
Dim myReader As OdbcDataReader = myOdbcCommand2.ExecuteReader()
Dim nestedRepeater as Repeater = e.item.FindControl("opts")
if (Not nestedrepeater Is Nothing) then
nestedRepeater.DataSource = myReader
nestedRepeater.DataBind()
end if
myOdbcCommand2.Connection.Close()
oODBCConnection2.Close()
end if
end sub






<asp:repeater id="questions" runat="server">

<headertemplate>



<itemtemplate>


<footertemplate>
idquestion
<%#Container.DataItem("id")%> <%#Container.DataItem("question")%>
<asp:repeater id="opts" runat="server">
<headertemplate>


<itemtemplate>

<footertemplate>
<%#Container.DataItem("opt")%>













I there anyone out there smart enough to get it to work? What am I doing wrong.
GeneralRe: nested repeaters in vb.net Pin
bigtone786-Dec-04 6:48
bigtone786-Dec-04 6:48 
GeneralRe: nested repeaters in vb.net Pin
Dave Kreskowiak6-Dec-04 7:46
mveDave Kreskowiak6-Dec-04 7:46 
GeneralRe: nested repeaters in vb.net Pin
bigtone786-Dec-04 8:31
bigtone786-Dec-04 8:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.