Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("tblcgjh", "dwlb|cgdw|jd")
For Each nd As WinForm.TreeNode In trv.AllNodes
Dim dr As DataRow = nd.DataRow
If nd.Level = 0 Then
nd.Text = dr("dwlb") & "(" & DataTables("tblcgjh").Compute("count(dwlb)", "dwlb = '" & dr("dwlb") & "'") & ")"
Else If nd.Level = 1 Then
nd.Text = dr("cgdw") & "(" & DataTables("tblcgjh").Compute("count(dwlb)", "dwlb = '" & dr("dwlb") & "' and cgdw = '" & dr("cgdw") & "'") & ")"
Else If nd.Level = 2 Then
nd.Text = dr("jd") & "(" & DataTables("tblcgjh").Compute("count(dwlb)", "dwlb = '" & dr("dwlb") & "' and cgdw = '" & dr("cgdw") & "' and jd = '" & dr("jd") & "'") & ")"
End If
Next
trv.Nodes.Insert("显示所有行",0)