Threading Ussue

  • Thread starter Thread starter paulg
  • Start date Start date
P

paulg

hi
I am new to dot net. The problem I am having now is that I would like a
thread to feed data from database to a arraylist at background and at the
same time I want to display the objects in the arraylist in a form.

The brief code is:

private ArrayList CustomerList;
public Form_Load(){

Thread loadThread = new Thread(new ThreadStart(Loaddata));
loadThread.Start();
DisplayData();
....
....
}
private void LoadData(){
//get customer objects from database and add them to arrayList
}
private void DisplayData(){
Customer c = (Customer)CustomerList[0];
this.txtFirstName=c.FirstName;
.....
}


However I got exception:"Error creating windows handler,
OutOfMemoryException.

Can someone please point me what the problem is and how to get around it?
Thanks in Advance.
 
Hi Paulg,

Although here are also C# people active, this is typical a question for the
newsgroup beneath and because it is weekend in the EU and US, I would try
it in that newsgroup also

news://msnews.microsoft.com/microsoft.public.dotnet.languages.csharp

I hope this helps you

Cor
 
Back
Top