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.
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.