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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
B
Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
S
SegmentFault 最新的问题
腾讯CDC
博客园 - 叶小钗
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
Jina AI
Jina AI
A
About on SuperTechFans
博客园 - 司徒正美
C
Check Point Blog
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
N
Netflix TechBlog - Medium
T
Tenable Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
小众软件
小众软件
Spread Privacy
Spread Privacy
阮一峰的网络日志
阮一峰的网络日志
Know Your Adversary
Know Your Adversary
NISL@THU
NISL@THU
K
Kaspersky official blog
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
D
DataBreaches.Net
A
Arctic Wolf
I
InfoQ
量子位
IT之家
IT之家
Security Latest
Security Latest
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
Google Developers Blog
P
Proofpoint News Feed
P
Privacy International News Feed
T
Threatpost
L
Lohrmann on Cybersecurity
P
Proofpoint News Feed
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
Martin Fowler
Martin Fowler
C
Cyber Attacks, Cyber Crime and Cyber Security
PCI Perspectives
PCI Perspectives
F
Full Disclosure

博客园 - 流浪浪

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);
            }
        }
    }