Dim cmd As New SQLCommand Dim dt As DataTable cmd.CommandText = "SELECT DISTINCT Year(值班日期) As 年, Month(值班日期) As 月, 值班员, 值班种类 From {表A}" dt = cmd.ExecuteReader() Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") trv.BuildTree(dt, "年|月|值班员|值班种类")