TreeNode SolutionNode = nuovo TreeNode (“? ");
TreeNode TableNode = nuovo TreeNode (“? ");
TreeNode ColumnNode;
foreach (fila di DataRow in DT.Rows) {
Solution_Name = fila [0] .ToString ();
Table_Name = fila [1] .ToString ();
Column_Name = fila [2] .ToString ();
ColumnNode = nuovo TreeNode (Column_Name);
se (SolutionNode.Text! = Solution_Name) {
TableNode = nuovo TreeNode (Table_Name);
SolutionNode = nuovo TreeNode (Solution_Name);
TableNode.Nodes.Add (ColumnNode);
SolutionNode.Nodes.Add (TableNode);
treeView1.Nodes.Add (SolutionNode);
} altrimenti se (TableNode.Text! = Table_Name) {
TableNode = nuovo TreeNode (Table_Name);
TableNode.Nodes.Add (ColumnNode);
SolutionNode.Nodes.Add (TableNode);
} altrimenti se ((== Solution_Name di SolutionNode.Text) && (== Table_Name di TableNode.Text)) {
TableNode.Nodes.Add (ColumnNode);
}
}
|