View previous topic :: View next topic |
Author |
Message |
esanabia
Joined: 29 Sep 2008 Posts: 23
|
Posted: Wed Aug 19, 2009 1:44 am Post subject: Faster Performance |
|
|
Is there a way to re-populate my Virtual Tree using your Virtual Data Objects?
I have a list of records. When the user clicks on one of the items in the list, I re-populate my virtual tree with some detailed information. I run the following 3 lines of code to repopulate the tree...
_vtAccessories.SuspendLayout()
_vtAccessories.DataSource = New AccessoryRecordset(lngCabinetRunID)
_vtAccessories.ResumeLayout()
The returned recordset is very small (1 or 2 records). Nevertheless, it takes about 3 seconds to repopulate the tree. Is there another method I should be using?
Thanks for your help. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Aug 19, 2009 10:45 pm Post subject: |
|
|
Three seconds is definitely way too long. If you run the Database Browser sample (in Virtual Tree samples) and put a break point on the line
Code: | _virtualTree.DataSource = New VehicleRecordset |
You will see that the time for the tree to be populated (after clicking run from this point) is almost instantaneous - even for a very large recordset.
I suspect it is probably an issue with either the database or the query you are using. What database backend are you using?
If you look in the trace (output) window while debugging you will see that Virtual Data dumps out the actual ADODB queries performed eg
Code: | VirtualData Query: SELECT * FROM Vehicle ORDER BY Model ASC |
You could try executing the query directly using ADODB to see if the problem lies in the database connection or query. _________________ Infralution Support |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
esanabia
Joined: 29 Sep 2008 Posts: 23
|
Posted: Thu Aug 20, 2009 12:57 am Post subject: |
|
|
It turns out the problems was with another query - nothing to do with the setting the data source property. Problem solved.
Thanks for your help. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|