楼主用的是外部数据库?
看图片貌似是动态加载树,按理说你的要求需要编码用目录树来实现
Dim cmd As New SQLCommand
cmd.Connection Name = "JRRJ"
Dim dt As DataTable
cmd.CommandText = "Select a.客户id,a.销售单号,b.客户名称 From {销售订单} a,客户资料 b where a.客户id = b.客户id and a.订单日期 = '" & d1 & "' "
dt = cmd.ExecuteReader()
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.Nodes.Add("加载所有数据",0)
For Each dr As DataRow In dt.DataRows
Dim tnd As WinForm.TreeNode = trv.Nodes.Add(dr("客户id"),dr("客户id") & dr("客户名称"))
For Each trvstr As String In dt.GetUniqueValues("客户id = '"& tnd.name &"'","销售单号")
tnd.Nodes.Add(trvstr,trvstr)
Next
Next
[此贴子已经被作者于2012-11-14 8:06:50编辑过]