R
RobRasti
Hi all, I hope someone can help.
I'm trying to read 27,000 records from a database at application start
up. This of course made the loading time really slow. So I used the
ThreadPool.QueueUserWorkItem and have the load taking place on that
background thread. Even with this background thread, the UI becomes
slow and unresponsive. Am I missing something here?
I'm using the MVC design pattern, so in the form constructor I
instantiate a Controller object. The Controller is what makes a call
a method I wrote Catalog.BeginLoad().
Catalog.BeginLoad()
ThreadPool.QueueUserWorkItem(new WaitCallback(getCatalog), new
object[] { _customerID, _callbackDelegate });
The getCatalog method unwraps the Object parameter of the WaitCallback
delegate and calls GetCatalog (The synchronous version of the code).
In the GetCatalog method I have a SqlCeDataReader that opens the table
and loops through the 27,000 records and turns them into an "in
memory" object representation of the Catalog.
I understand the reading from SQL CE will be slow, but I figured on a
background thread this would not affect the UI.
Any thoughts?
Thanks in advance.
-Rob-
I'm trying to read 27,000 records from a database at application start
up. This of course made the loading time really slow. So I used the
ThreadPool.QueueUserWorkItem and have the load taking place on that
background thread. Even with this background thread, the UI becomes
slow and unresponsive. Am I missing something here?
I'm using the MVC design pattern, so in the form constructor I
instantiate a Controller object. The Controller is what makes a call
a method I wrote Catalog.BeginLoad().
Catalog.BeginLoad()
ThreadPool.QueueUserWorkItem(new WaitCallback(getCatalog), new
object[] { _customerID, _callbackDelegate });
The getCatalog method unwraps the Object parameter of the WaitCallback
delegate and calls GetCatalog (The synchronous version of the code).
In the GetCatalog method I have a SqlCeDataReader that opens the table
and loops through the 27,000 records and turns them into an "in
memory" object representation of the Catalog.
I understand the reading from SQL CE will be slow, but I figured on a
background thread this would not affect the UI.
Any thoughts?
Thanks in advance.
-Rob-