Wrox Programmer Forums
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 13th, 2005, 08:59 AM
Authorized User
 
Join Date: Apr 2005
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to EricJ
Default Quick questiong!

I have a treeview control which gets populated by data from an SQL database but it takes about 7 - 10 seconds to populate the view. The table that I'm populating it with has about 246 entries which shouldn't be a bit issue for sql. Why is this happening?

 
Old July 13th, 2005, 12:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Drawing 246 items on your treeview will take a little bit of time. It likely isn't the database that is causing this, but the drawing of the nodes.

You can increase the speed somewhat by using the BeginUpdate method of the treeview prior to inserting the nodes, then using the EndUpdate method after all the nodes have been added. This will prevent re-drawing the treeview until all of the nodes have been added, which is really what is the likely culprit for the slow response time.

A better way of doing this is to add the parent nodes only when the form is loaded, then make a call to the database to populate that particular node with its children when it is clicked.

J





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a quick job done iced1992 Beginning PHP 0 January 9th, 2008 11:11 AM
i need help quick linkinboy Visual Basic 2005 Basics 11 October 25th, 2007 09:44 PM
Need Quick Help yikomaka Visual C++ 1 September 1st, 2005 05:33 PM
Just a quick one!!!(again) satts Access 11 February 22nd, 2005 06:36 PM
Need quick help please! lryckman Access VBA 2 January 12th, 2004 12:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.