Dim cmd As New SQLCommandDim dt As DataTablecmd.Ccmd.CommandText = "SELECT DISTINCT 部门,姓名,部门编号 From {员工档案}"dt = cmd.ExecuteReader()Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")trv.BuildTree(dt,"部门|姓名","","部门编号")
我是用以上代码建立目录树,在员工档案中添加姓名,然后保存,最后在日报表中选择姓名,刚添加的姓名不在目录树里面,需要将整个软件关闭,然后打开进入才在里面,这个应该怎样才能及时更新在目录树里面。