我已经把大类TreeView1循环出来了,可是小类如何在循环出来啊,根据大类ID查询出
我已经把大类循环出来了,可是小类如何在循环出来啊,根据大类ID查询出
'循环出大类
For i = 0 To ds.Tables("tabbigtype").Rows.Count - 1
Dim nod As New TreeNode
nod.Text = ds.Tables(0).Rows(i)(1).ToString
nod.Tag = ds.Tables(0).Rows(i)(0).ToString
TreeView1.Nodes.Add(nod)
‘这里循环出这个大类下的小类,
Next
Private Sub treelist()
TreeView1.Nodes.Clear()
sqlread("select * from MENU where root=0 order by id asc", "mastermenu")
For i As Integer = 0 To EchoDS.Tables("mastermenu").Rows.Count - 1
TreeView1.Nodes.Add(EchoDS.Tables("mastermenu").Rows(i).Item("id"), EchoDS.Tables("mastermenu").Rows(i).Item("menuname"))
sqlread("select* from MENU where root=" & _
EchoDS.Tables("mastermenu").Rows(i).Item("id") & " order by id asc", "Cmenu")
Dim pic As String
For j As Integer = 0 To EchoDS.Tables("Cmenu").Rows.Count - 1
TreeView1.Nodes.Item(Mid(EchoDS.Tables("Cmenu").Rows(j).Item("root"), 1, 3)) _
.Nodes.Add(EchoDS.Tables("Cmenu").Rows(j).Item("id"), _
EchoDS.Tables("Cmenu").Rows(j).Item("menuname"))
Next
EchoDS.Tables("子菜").Reset()
Next
EchoDS.Reset()
End Sub