I have a method that call another method from a class with references which in turn returns a datatable.
I'm trying to run that query in a thread, now to run the query itself in a thread is easy, but how do I get it to return the datatable from the thread?
Example of Method calling the class:
private void loadCombo(string sqlComand, string value, ComboBox loadBox)
{
DataTable dt = new DataTable();
//Thread thread = new Thread(() => sqlScript.loadCombo(sqlComand, value, loadBox));
//thread.start();
dt = sqlScript.loadCombo(sqlComand, value, loadBox);
loadBox.ValueMember = value;
loadBox.DataSource = dt;
loadBox.Refresh();
}