I have a small application in C# with data from Access.
I used listview and it's work ........ standard table in Access have about 10000 rows. Listview load all rows with data about 30 seconds.
but when it's 100000 the listview don't work. Application load data over 15 minuts using 80% procesor
this my code ........... Where is the problem ??? . I don,t want used DataGrid ....... Listview looks better.
while (reader.Read() == true)
{
lvItem = listView1.Items.Add(reader.GetValue(0).ToString());
for (int i = 1; i < nCount; i++)
{
lvItem.SubItems.Add(reader.GetValue(i).ToString());
}
}
Thanks :)
Sorry for my English :)
bartek bartekPosted Apr 27, 2009, 7:24 AM
it's one of the method but there are over 200000 rows.
too many next to go to the middle of list
For now I handled with that problem, I changed the method of connection and now it's takes about 60-90 seconds(before I changed it was 15 minuts !!! )
RameshPosted Apr 27, 2009, 6:14 AM
Hi,
You can load first 100 or 200 records into your listview at a time to improve performance. If the user want to view next 100 or 200 records, you can hit database again and load them.
The second option: (If you are using windows forms)
1. Load first 100 or 200 records.
2. Use a background worker to load all record from DB to a dataset.
3. Handle all prev,next operations from dataset.
Regards,
Ramesh