Tom Newman
Member
I'm currently developing a management application for a client. As the application retrieves data from a remote database, I aim to use multi-threading to allow the best functionality.
I would appreciate any advice on the following scenario. I need to open a form which contains a ComboBox which is populated with data from the database. I would ideally like the ComboBox to to be populated within a different thread; it would be preferable if the form could be hidden until this population is completed.
My main issue lies with transferring data inbetween threads. At the current time, I reference a class function which gets the data for the ComboBox in the form of a DataTable. The ComboBox data source is set to the DataTable which leads to its population. My attempts so far have resulted in cross-thread violations, as I try to set the ComboBox data source from a different thread. I have tried to have a look at information on delegates, however none of the tutorials seem to fit my context.
This is my first attempt at multi-threading, and would appreciate any help anyone can provide to ease the attempt.
Kindest Regards
Tom Newman
I would appreciate any advice on the following scenario. I need to open a form which contains a ComboBox which is populated with data from the database. I would ideally like the ComboBox to to be populated within a different thread; it would be preferable if the form could be hidden until this population is completed.
My main issue lies with transferring data inbetween threads. At the current time, I reference a class function which gets the data for the ComboBox in the form of a DataTable. The ComboBox data source is set to the DataTable which leads to its population. My attempts so far have resulted in cross-thread violations, as I try to set the ComboBox data source from a different thread. I have tried to have a look at information on delegates, however none of the tutorials seem to fit my context.
This is my first attempt at multi-threading, and would appreciate any help anyone can provide to ease the attempt.
Kindest Regards
Tom Newman