本文介绍了如何根据使用MFC树控件的某些关系表来表示树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用从数据库(MySQL)获得的一些关系表。这些表有关系数据;例如:表权限包括数据DepartmentID结构,表部门也包括它。

树如下:(00代表树的根节点ID,0102 0304是00的子节点。它们属于同一类。就像这样,0101是01的子节点;010101是0101的子节点; 01010101是010101的子节点......)

00CompanyName

01Department1_Name

0101Department1_Sub1_Name

010101Department1_Sub1_Sub1_Name

01010101Department1_Sub1_Sub1_Sub1_Name

02Department2_Name

0201 Department2_Sub1_Name

020101Department2_Sub1_Sub1_Name

020102Department2_Sub1_Sub2_Name



03Department3_Name

0301Department3_Sub1_Name

0302Department3_Sub2_Name

04Department4_Name



我有什么试过:



首先,从数据库(MySQL)保存表。目前我使用地图和矢量格式来保存数据。



其次,根据这些表中的关系数据表示节点关系(目前我使用while和find方式来表示但是性能和速度太差了因为有大量的数据)



第三,我根据这些节点使用MFC树控件来表示关系树(现在我使用的是从所有节点然后将节点插入树中。当然慢慢加速)

I want to use some relational tables obtained from the database(MySQL).These tables has relational data ; For example: Table Permission includes data "DepartmentID" structure and Table Department also includes it.
The tree like followings:("00" stands for the root node ID of the tree,"01" "02" "03" "04" are the child node of "00" .They belongs to the same class .Like this ,"0101" is the child node of "01" ;"010101" is the child node of "0101" ; "01010101" is the child node of "010101" ......)
"00" CompanyName
"01" Department1_Name
"0101" Department1_Sub1_Name
"010101" Department1_Sub1_Sub1_Name
"01010101" Department1_Sub1_Sub1_Sub1_Name
"02" Department2_Name
"0201" Department2_Sub1_Name
"020101" Department2_Sub1_Sub1_Name
"020102" Department2_Sub1_Sub2_Name

"03" Department3_Name
"0301" Department3_Sub1_Name
"0302" Department3_Sub2_Name
"04" Department4_Name

What I have tried:

Firstly,saving the tables from the database(MySQL).Currently I use the map and vector format to save the data.

Secondly,representing the node relationship according to the relational data in these tables(currently I use the "while" and "find" ways to represent BUT the performance and speed is too bad because of the much amount of data)

Thirdly,I use the MFC Tree Control to represent a relation-tree according to these nodes (Now I use the retrival ways from all of the nodes and then insert node into the tree .Of course slowly speed)

推荐答案


这篇关于如何根据使用MFC树控件的某些关系表来表示树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 03:13