TreeView and memory questions

  • Thread starter Thread starter Woody Splawn
  • Start date Start date
W

Woody Splawn

I have a treeview that I use in a winform that allows for easily finding a
particular record in a fairly large database. The tree structure is as
follows

Alameda
A
B
C etc
Sacramento
A
B
Barton; Bill
Bitwell, Mary
Burton, John etc
C
D. etc

Seattle
A
B
C etc.
Houston etc.


It is possible for this form to be brought to the screen and remain open
over a long period of time. During the course of that time the user may go
into the treevieww numerous times which means, over time, the user could
have retrieved a large number of records, even if is only First and Last
name. I am wondering what this might do with regard to memory. I suppose
if the user left the window open and accessed the treeview enough times he
they could run out of memory. I wonder if there is something I could
(should) do to compensate for this. For example, it occurs to me that I
could allow them some sort of short-cut key that could be pressed from time
to time to collapse all TreeNodes and Clear all tree nodes. If I did this,
would it actually return or recover any memory? Is there anything I can do
to keep the memory high short of closing and reopening the Winform?
 
Are you useing a datareader/dataset object? If you are then you might want
to return the results as an XML file and then bind you're tree view to it.
I believe this would also allow you to use XPath to create search
functionality. In any case, I would think you should plan to have a manual
data refresh method. I don't think you want to hit the database everytime
your user clicks.
 
Back
Top