惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
F
Full Disclosure
博客园 - 【当耐特】
博客园 - 司徒正美
V
Visual Studio Blog
F
Fortinet All Blogs
T
Tor Project blog
T
Threatpost
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
C
Cyber Attacks, Cyber Crime and Cyber Security
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tenable Blog
M
MIT News - Artificial intelligence
L
Lohrmann on Cybersecurity
P
Palo Alto Networks Blog
I
Intezer
Stack Overflow Blog
Stack Overflow Blog
The Register - Security
The Register - Security
The Last Watchdog
The Last Watchdog
S
Securelist
T
Tailwind CSS Blog
V
Vulnerabilities – Threatpost
U
Unit 42
博客园 - 叶小钗
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
Hacker News - Newest:
Hacker News - Newest: "LLM"
NISL@THU
NISL@THU
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
SecWiki News
SecWiki News
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
TaoSecurity Blog
TaoSecurity Blog
A
Arctic Wolf
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
N
News | PayPal Newsroom

博客园 - 流浪浪

SQL截取字符串 SQL Server中各个系统表的作用 editor.js 缺少对象的解决方法(ewebeditor 使用) asp.net DataList中hyperlink传递参数及打开新页面全解 vs2005 c#鼠标悬停高亮显示在gridview中 li:hover ul,li.over ul{ display: block;}这句被ie6.0解释不了 CSS + JavaScript 利用display:none/block 构造弹出菜单 23种设计模式的通俗理解 myeclipse9.0破解方法 C#弹出选择对话框的程序 sql语句中调用将汉字转换为拼音函数 sql将汉字首字转化为拼音 “IE7中Frameset页面显示不全”问题的原因与解决方案 (转) sql语句获取本周、本月数据 解决gridview导出到excel中汉字出现乱码的问题 - 流浪浪 - 博客园 (转)IT人士群聚喝酒 Better Man 倒春寒 恨铁不成钢啊!
使用递归的方法生产TreeView
流浪浪 · 2012-01-04 · via 博客园 - 流浪浪

    public void ParentNode()    //创建父节点
    {
        string sql;
        if (p == "999999")
        {
            sql = "select id,LBMC from WJLBB where parent_id=0";
        }
        else
        {
            sql = "select id,LBMC from WJLBB where parent_id=0 and bmbh='" + bmbh + "'";
        }
        DataSet ds = newdbclient.DataSets(sql);
        if (ds.Tables[0].Rows.Count != 0)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                TreeNode tn = new TreeNode();
                tn.Text = ds.Tables[0].Rows[i]["LBMC"].ToString();
                tn.Value = ds.Tables[0].Rows[i]["id"].ToString();
                TreeView1.Nodes.Add(tn);
                ChildNode(tn, tn.Value);
                //this.treeView1.Nodes.Add("onclick", "CheckEvent()");
            }
        }

    }

    public void ChildNode(TreeNode node, string fdeptid)    //递归取出父节点下的子节点
    {
        string sql = "select id,LBMC from WJLBB where kf='开放' and parent_id='" + fdeptid + "'";
        DataSet ds = newdbclient.DataSets(sql);
        if (ds.Tables[0].Rows.Count != 0)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                TreeNode tn = new TreeNode();
                tn.Text = ds.Tables[0].Rows[i]["LBMC"].ToString();
                tn.Value = ds.Tables[0].Rows[i]["id"].ToString();
                node.ChildNodes.Add(tn);
                //UserNode(tn, tn.Value);     //在子节点下创建人员节点
                ChildNode(tn, tn.Value);
            }
        }
    }