I have a bunch of listboxes on my windows forms with a couple of thousand records in each one of them. It takes almost about a minute to load a form in .NET 1.1 We are migrating the application to .NET 2.0 and was wondering if there is any way to improve the performance in ADO.NET 2.0 so that the listboxes are loaded faster in .NET 2.0
I tried running speed test as per:
http://msdn.microsoft.com/msdnmag/issues/05/11/DataPoints/default.aspx fig=true#fig6
and was really satisfied with the promising results.
Please let me know if you have general tips / suggestions to improve performance of ADO.NET Windows Forms Application in general. I have already read a bunch of articles that came up through a simple google search but was wondering if someone has already worked on something similar.
Thanks
csharpkid@gmail.com

How to improve Listbox performance in ADO.NET 2.0?
Hassano
In 1.1 we were directly binding the listbox / combobox to a field in the datatable to add the items.
JMakitalo
I don't have that much experience with databinding to say if you do anything incorrect or that it could be done better..
You can check out the forum for databinding if you have not already done it.
http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=7&SiteID=1
Keldon Alleyne
Alexander M.
I would not call it to fake better user experience. If the user gets a better experience and the job done, what is fake about it
I could imagine a few things you could do to load up the items at startup and give a better user experience than taking a minute to display it. However I have no clue how you are adding the items so my ideas might be useless for you.
If you are using Add() and add each item individually I would check consider building up my own array of items and then using AddRange() to add them all at once to the control.
Load the items asynchron, the form will display quick but not all data will be there until finish loading the items.
Ben B
Well, going back,.... a solution that I had already thought about, but I think it is really a 'work-around' and not a performance gain. A little bit disappointment considering other big improvements to ADO.NET 2.0.
My earlier thoughts were not to load thousands of records into a listbox in the first place. As you have suggested this will not really help in performance but at least it would FAKE a better user experience which should be alright I guess.
Thanks for your response anyway.
dotnetwiz
HoustonRocket
If you really want to provide a better user experience... perhaps you should be thinking on using a Tree... or several "nested" comboboxes...
CaptMcCrank
My suggestion would be to not load thousand of items into a listbox. Start up the form empty and have a search functionality for the listbox that only loads up a subset of all entries, if the user enters some search criteria.
This will not really help in performance but I would like better to work with an application like that. For me it increases the user experience.
If a user interface is responsive and set the expectation that something can take long time users a less likely to complain about it. If a form would take as long as a minute to be displayed I would use task manager to kill it even before it would present it to me. I would not kill it if I initiate an action to search for thousand of records to populate a listbox.
End result is basically the same but my experience of it would be totally different.