Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
nodo("")
End Sub
'los campos de la vase de datos son:
'padre,hijo,id
Public Sub nodo(ByVal padre As String)
Dim ds As New DataSet
bd.conecta("select * from arbol where padre='" & padre & "'", "nodo", ds)
Dim n As DataRow
Dim x As TreeNode
x = tv1.Nodes(padre)
For Each n In ds.Tables("nodo").Rows
x.Nodes.Add(n("id"), n("nodo"))
nodo(n("id"))
Next
End Sub