Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

treeview with database

Hi all,

I want to create a treeview with multiple level, the source will read from the database. but i can't find the way to implement that dynamic multi-level tree. could anyone give me an example?

Data sample:
A
AB
ABA
ABAA
AC
ACA
ADA
B
BA
.
.
.

thanks


mReader = mclsDBCon.runReader(strSQL)
TreeView1.Nodes.Clear()
Dim node As TreeNode
Do While mReader.Read

If Len(Trim(mReader.GetValue(0).ToString)) = 1 Then
node = TreeView1.Nodes.Add(Trim(mReader.GetValue(1).ToString))
Else
node.Nodes.Add(Trim(mReader.GetValue(1).ToString))
End If
Loop
[781 byte] By [yolip] at [2007-11-11 8:27:27]