/// <param name="newTreeView">樹型控件名稱</param>
/// <param name="TreeViewName">一層的功能名稱</param>
/// <param name="TableName">數據庫中的表名</param>
/// <param name="ParentNameField">父節點的字段名</param>
/// <param name="CurrentNameField">節點的字段名</param>
/// <param name="CurrentDataField">節點的數據</param>
newTreeInfoBll.InitTreeData(this.treeView1,"系統業務表","T_S_SystemTableIndex","pid000","name00","id0000");
有什麼不懂的或不明白的地方請大家給我發EMAIL,謝謝,希望大家一起進步
---------------------------------
TREEINFO.CS = 數據控制層
using System;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
/// <summary>
/// TreeInfo
/// 樹型初使化數據庫的所有信息
/// 喬高峰 2005-04-26
/// 功能:實現所有樹型的初使化
/// </summary>
public class TreeInfo
{
// private string PARM_TableName;
/// <summary>
/// 取某表的所有數據(缺少表名)
/// </summary>
private string SQL_SELECT_TREE = "SELECT * FROM ";
/// <summary>
/// 保存結果的數據集
/// scf
/// </summary>
private DataSet newDataSet;
/// <summary>
/// 為過濾方便的視圖
/// </summary>
private DataView newDataView;
/// <summary>
/// 無參數的構造函數
/// </summary>
public TreeInfo()
{
}
/// <summary>
/// 初使化樹型
/// 喬高峰 2005-04-28
/// </summary>
/// <param name="newTreeView">樹型控件名稱</param>
/// <param name="TreeViewName">一層的功能名稱</param>
/// <param name="TableName">數據庫中的表名</param>
/// <param name="ParentNameField">父節點的字段名</param>
/// <param name="CurrentNameField">節點的字段名</param>
/// <param name="CurrentDataField">節點的數據</param>
public void InitTreeData(TreeView newTreeView,string TreeViewName,string TableName,string ParentNameField,string CurrentNameField,string CurrentDataField)
{
//增加第一層節點的名稱,為該樹的功能名稱
TreeNode newTreeViewName = new TreeNode();
//設置該節點的顯示文本
newTreeViewName.Text = TreeViewName;
////樹型的圖標
//newTreeViewName.ImageIndex = ;
////選擇時的圖標
//newTreeVie
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一頁 >>