摘要: 有时候的树结构更复杂,层数多,可能不止在一个表中查询。如一个项目中的树结构:层数不固定,最后的树叶层时从不同的表中查询得到。先利用了上一篇中生成树的方法:表中的结构和上篇中的机构基本相同。private void CreateTree(TreeNode PNode, int traceCode) { string strSql = "select treecode,treename from TraceTree where ptreecode = " + traceCode; DataTable dt = SqlClass.GetTab... 阅读全文
posted @ 2012-12-17 14:41 googlg 阅读(9211) 评论(0) 推荐(2) 编辑
摘要: 需要添加到TreeView 中的数据在数据库中的存储表: ID 为主键,PID 表明数据之间的关系。/// <summary>/// 生产树的代码;/// </summary>/// <param name="node"> 根节点</param>/// <param name="id">主键</param> private void CreateTwo(TreeNode node, int id) { string strSql = "select * from Table 阅读全文
posted @ 2012-12-17 11:28 googlg 阅读(8125) 评论(0) 推荐(1) 编辑