Setting Listbox datasource from Arraylist takes too long

sudhindrashamanna

New member
Joined
Jun 1, 2006
Messages
1
Programming Experience
5-10
Hi,
I have about four window forms all having similar listboxes with same names and the following in the form load event (condensed but reasonably accurate)
VB.NET:
Dim employeeArrayList As ArrayList
Dim employeeDAO As New EmployeeDAO
employeeArrayList = employeeDAO.GetAllData
lbEmployee.DataSource = employeeArrayList
The first time any of the form is opened the fourth line of the code takes about 925 ms. If the form is closed and any of the forms is again opened (without closing the application), the time taken is about 15 ms. Considering that the objects are local to the form I find it surprising.
Any ideas?
Thanks and regards.
 
Back
Top