Hi Experts,
In my c# windows application,
I have two buttons export and cancel.
In my export button, here i am exporting sql datatable to .csv file.its running under the thread.
thrThreadExportProcess = new Thread(new ThreadStart(startExport));
thrThreadExportProcess.Start();
thrThreadExportProcess.IsBackground = true;
while its exporting process is running, user hits the cancel button here i am aborting the thread,then joining the thread and deleting the exported file.
while its joining Thread, application get hangs up some time then it will run.
my question is why its hangs up some time.
here is the part of the code in cancel button.
if (thrThreadExportProcess.IsAlive)
{
thrThreadExportProcess.Abort();
thrThreadExportProcess.Join();
File.Delete(csvPath);
}
Kindly provide your valuble Suggestions.