steve4king
IS-IT--Management
I've got a simple application partially for work, partially to learn.
The program connects to a database, gathers a total record count, displays that count, then walks through each item, displaying the current record number as it goes.
All of the database queries happen on a background worker thread. The program works if I declare a few class level variables, and update those variables directly from the background worker thread method. Then during the progress changed method I set the UI component to the class variable.
I've been reading a bit about thread-safety and I'm not sure whether this is a good idea or whether I need to be passing all of these variables explicitly from method to method rather than method to class to method.
I've probably made this very confusing, and if so I apologize hehe.
Thanks for any help!
The program connects to a database, gathers a total record count, displays that count, then walks through each item, displaying the current record number as it goes.
All of the database queries happen on a background worker thread. The program works if I declare a few class level variables, and update those variables directly from the background worker thread method. Then during the progress changed method I set the UI component to the class variable.
I've been reading a bit about thread-safety and I'm not sure whether this is a good idea or whether I need to be passing all of these variables explicitly from method to method rather than method to class to method.
I've probably made this very confusing, and if so I apologize hehe.
Thanks for any help!