Board index » cppbuilder » I need help on TreeView & DB

I need help on TreeView & DB


2004-01-16 05:04:15 PM
cppbuilder75
Hello All,
I'm having a problem in my project which is very critical. In my
project I'm using a TreeView Control and the values of the TreeView
come from Oracle DB.
The structure of the DB is (ID, CHILDOF, NAME). Here ID is a numeric
primary key, CHILDOF is a numeric field which stores ID value (this ID
value will be parent node). All the records having same CHILDOF value
become children of same Parent node.
In programme code I search the names of tree nodes which are already
inserted. After getting the treenode, i make the new node its child.
This structure is quite good when the records in table are few. But
Now I have anout 3000 records in Table and searching 3000 treenodes
takes a long time.
I've tried also with TreeNode Data, and then searching the node by
Data of parent, but it takes same time.
If someone can give me hint to improve the whole above process, I'll
be thankful.
Regards,
Attiq ur Rehman
 
 

Re:I need help on TreeView & DB

Hi,
Late suggestion (you might have found a solution already). I was just
thinking that the TreeView component has a method for initializing from
file. Would it be more efficient for you to build a text file (tabs to
indicate the node level), and call the TreeView->LoadFromFile(..) method ?
Maybe that would save some time in searching the treeview. Just a
suggestion - I have not tried if it is more efficient as my treeview
component contains only a few hundred nodes.
Regards,
Per Anders Johnsen.
Norway.
NB: I'm using the TreeView component with some database stuff too, and I was
wondering why noone has developed a TDBTreeView component... The parent /
child relation could easily be used to link relational datasets.
"Attiq ur Rehman" < XXXX@XXXXX.COM >wrote in message
Quote
Hello All,

I'm having a problem in my project which is very critical. In my
project I'm using a TreeView Control and the values of the TreeView
come from Oracle DB.

The structure of the DB is (ID, CHILDOF, NAME). Here ID is a numeric
primary key, CHILDOF is a numeric field which stores ID value (this ID
value will be parent node). All the records having same CHILDOF value
become children of same Parent node.

In programme code I search the names of tree nodes which are already
inserted. After getting the treenode, i make the new node its child.


This structure is quite good when the records in table are few. But
Now I have anout 3000 records in Table and searching 3000 treenodes
takes a long time.

I've tried also with TreeNode Data, and then searching the node by
Data of parent, but it takes same time.

If someone can give me hint to improve the whole above process, I'll
be thankful.



Regards,
Attiq ur Rehman