Possible Duplicate:
Timing issue - DGV refreshes before process amends the data
I've got the following code
private void btRunReport_Click(object sender, EventArgs e){
Process p = new Process();
p.StartInfo.FileName = @"\\fileserve\department$\ReportScheduler_v3.exe";
p.StartInfo.Arguments = "12";
p.Start();
p.WaitForExit();
InitializeGridView();
}
p will update a database table X. InitializeGridView updates a DGV which reflects table X.
Problem is that if p takes 10minutes to run then the winForm is frozen witing before it hits InitializeGridView(). What I need help with is how do i make the form start the process in a seperate thread that works behind the scenes and runs InitializeGridView() ?