求用asp.net(vb)树型目录的源代码
请各位高手帮忙,给一段调用数据库中数据的树型目录的源代码 --------------------编程问答-------------------- MSDN里有 --------------------编程问答-------------------- 什么竖形目录,TreeView就是了 --------------------编程问答-------------------- Dim i, ParentNode, NodeId As IntegerDim myConnection As New OracleConnection(ConfigurationSettings.AppSettings("ConnectionString"))
myConnection.open()
Dim Sql As String = "select DEPTID,DEPTNAME,LastDeptID FROM DEPTINFO ORDER BY deptID"
Dim Cmd As New Oraclecommand(Sql, myConnection)
Dim DataR As OracleDataReader = Cmd.ExecuteReader
Dim menuNodes(3500) As TreeNode
For i = 0 To menuNodes.Length - 1
menuNodes(i) = New TreeNode
Next
Do While DataR.Read
ParentNode = DataR("LastDeptID")
NodeId = DataR("deptID")
menuNodes(NodeId).Text = DataR("DEPTNAME")
menuNodes(NodeId).NavigateUrl = "UserInfo.aspx?ClassID=" & NodeId
menuNodes(NodeId).Target = "_top"
If ParentNode <> 0 Then
menuNodes(ParentNode).ChildNodes.Add(menuNodes(NodeId))
Else
TreeView1.Nodes.Add(menuNodes(NodeId))
End If
Loop
DataR.Close()
MyConnection.Close()
myConnection.Dispose()
补充:.NET技术 , ASP.NET