Click here to Skip to main content
15,887,214 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
GeneralRe: nested repeaters in vb.net Pin
Dave Kreskowiak6-Dec-04 8:50
mveDave Kreskowiak6-Dec-04 8:50 
GeneralFor next loop with DB GRID Pin
Paps26-Dec-04 5:50
Paps26-Dec-04 5:50 
GeneralRe: For next loop with DB GRID Pin
jlawren76-Dec-04 11:29
jlawren76-Dec-04 11:29 
GeneralRe: For next loop with DB GRID Pin
Paps27-Dec-04 3:05
Paps27-Dec-04 3:05 
GeneralTab control ... Pin
AbuFahed6-Dec-04 1:22
AbuFahed6-Dec-04 1:22 
GeneralRe: Tab control ... Pin
Pablo.ar7-Dec-04 0:45
Pablo.ar7-Dec-04 0:45 
QuestionHow do you create a transparent label on a gradient colored form? Pin
David M J6-Dec-04 0:24
David M J6-Dec-04 0:24 
AnswerRe: How do you create a transparent label on a gradient colored form? Pin
The Man from U.N.C.L.E.8-Dec-04 3:31
The Man from U.N.C.L.E.8-Dec-04 3:31 
GeneralRe: How do you create a transparent label on a gradient colored form? Pin
David M J9-Dec-04 6:59
David M J9-Dec-04 6:59 
GeneralRe: How do you create a transparent label on a gradient colored form? Pin
The Man from U.N.C.L.E.10-Dec-04 0:57
The Man from U.N.C.L.E.10-Dec-04 0:57 
GeneralRe: How do you create a transparent label on a gradient colored form? Pin
David M J10-Dec-04 22:36
David M J10-Dec-04 22:36 
GeneralCrystal reports"Numbers to words" Pin
anom2m6-Dec-04 0:19
anom2m6-Dec-04 0:19 
GeneralUrgent: Killing Threads Pin
cwayman5-Dec-04 23:02
cwayman5-Dec-04 23:02 
GeneralHook Messages or ... Pin
rdges5-Dec-04 21:50
rdges5-Dec-04 21:50 

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.