Código vb:
Ver originalSub Page_Load(Sender As Object, E As EventArgs)
Dim reader As SqlDataReader
Dim values As ArrayList = New ArrayList()
Dim values2 As ArrayList = New ArrayList()
Dim conn As SqlConnection =
New SqlConnection("server=myhost;database=mydb;User ID=myuser;Password=mypass;Trusted_Connection=no")
Dim sql As String =
"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS GROUP BY TABLE_NAME"
Dim dr As New SqlCommand(sql, conn)
reader = dr.ExecuteReader()
While reader.Read()
LISTBOX1.INSERT(0,READER.VALUE)
End While
reader.Close()
DIM CADENA AS STRING = LISTBOX1.SELECTITEM
Dim sql2 As String =
"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE NAME =" & CADENA & "GROUP BY COLUMN_NAME"
Dim dr2 As New SqlCommand(sql2, conn)
reader = dr2.ExecuteReader()
While reader.Read()
LISTBOX2.INSERT(0,READER.VALUE)
End While
lb.DataSource = values
lb.DataBind()
lb2.DataSource = values2
lb2.DataBind()
reader.Close()
conn.Close()
End Sub
ES MAS O MENOS ASI LA LOGICA, TRATA DE ADAPTARLO