Hi,

I am running the piece of code below, and I am getting an exception error
when trying to Abort the threads.   This does not happen consistently
though, it is very random.  What might be the problem here??

Thanks.
John

BarText = "Retrieving data ......";
StartProgThread(ThreadName);
OleDbDataAdapter DataAdapter2 = new OleDbDataAdapter(filterString, cn);
DataAdapter2.Fill (DTable);
ThreadTwo.Abort();
BarText = "Writing data ....";
StartProgThread(ThreadName);
dataGrid1.DataSource   = DTable;
ThreadTwo.Abort();
confirmflag = 1;

public void StartProgThread(string TName)
{
ThreadTwo = new Thread (new ThreadStart(DisplayProgBar));
ThreadTwo.Priority = ThreadPriority.AboveNormal;
ThreadTwo.Start();
}


public void DisplayProgBar()
{
 Thread current = Thread.CurrentThread;
 Console.WriteLine(current.Name);
 progress = new ProgressBar(BarText);
}

Reply via email to