el código que tengo es el siguiente
Código PHP:
Imports AjaxControlToolkit
Imports System.Data.Sql
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
con = New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
cmd = New SqlCommand()
cmd.CommandType = Data.CommandType.Text
con.Open()
cmd.Connection = con
'cmd.CommandText = "select * from T_curso inner Join T_Materias on T_curso.c_id = T_Materias.c_idcurso where T_Materias.c_idcurso = 2"
cmd.CommandText = "select * from T_menu inner Join T_submenu on T_menu.c_idmenu = T_submenu.c_idmenu where T_menu.c_idalumno = 1"
dr = cmd.ExecuteReader
Dim titleLabel As New WebControls.Label
titleLabel.ID = "TitleLabel"
titleLabel.Font.Italic = True
titleLabel.Text = "Hola"
' TO DO : Exception treatment.
Accordion1.Panes.Item(0).HeaderContainer.Controls.Add(titleLabel)
Do While dr.Read
Dim titleLabel2 As New WebControls.Label
titleLabel2.ID = "TitleLabel"
titleLabel2.Font.Italic = True
Dim p As AccordionPane
p = New AccordionPane
p.Controls(0).Controls.Add(titleLabel2)
titleLabel2.Text = dr("c_nmenu")
Dim titleLabel3 As New Label
titleLabel3.Text = dr("c_nsumbenu") & Chr(13)
p.Controls(1).Controls.Add(titleLabel3)
Accordion1.Panes.Add(p)
Loop
End Sub
End Class