cmd.ConnectionName = "数据库名" Dim dt As DataTable cmd.CommandText = "SELECT DISTINCT 产品名称,产品型号 F rom {BOM}" dt = cmd.ExecuteReader() Dim trv As WinForm.TreeView = e.F orm.Controls("TreeView-BOM") trv.BuildTree(dt,"产品名称|产品型号") trv.Nodes.Insert("加载所有数据",0)