向treeview中加载数据

1、获取树节点的值,用事件AfterSelect加载(id值的获取,用name来获取)

2、双击treeview控件得到

private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            string sql = "select * from emp";
            )//Level控件中树视图的深度
                sql = "select * from emp where dept_id=" + e.Node.Tag;//
            DataTable dt = DbAccess.MySqlHelper.getDataTable(sql);
            this.dataGridView1.DataSource = dt;
        }
上一篇:比赛F-F Perpetuum Mobile


下一篇:密码正确 mysql无法登陆 red7.3 上安装mysql5.6后登录报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passswd :yes)