I am very very new to WPF. I looked in the internet for several examples and tutorials about threading. They\'ve their own way to describe. But for naive like me, I want to
Multithreading hasn't anything to deal with the UI techinque you are choosing (Wpf or Winforms) - there are only slight differences when you have to switch to the UI thread to update your controls.
According to your code sample, I must say, that there is no callback possibility from sql server to your program. If you want to have that feature, you have to implement the loop in C# not in a sql statement.
Edit:
According to the comment of OP I add a sample of background working and updating UI in foreground with TPL (Task Parallel Library):
var task = new Task(() =>
{
// Do something very long ...
});
task.ContinueWith((previousTask) =>
{
label.Content = "Background work has finished.";
},
TaskScheduler.FromCurrentSynchronizationContext());
label.Content = "Background work is running.";
task.Start();