Solved

Delphi ListView and LARGE query

Posted on 2003-11-12
5
605 Views
Last Modified: 2008-03-10
Greetings

I have a listview on my form that gets populated by records from either a flat file or SQL server database.

With the flat file for example, if the amount of records starts to exceed 10 000
the reporting becomes way to slow and GUI locks up while in the loop of retrieving the records.

Should I look at having a seperate thread doing the work ?

Iterating through the records consumes only a couple of seconds, but uncommenting the code that places the data in the listview and then running the query takes up time ?

Any suggestions ?
 
Regards
 Engwi
0
Comment
Question by:Engwi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9737528
Ok

some suggestions

1. If you are getting total information with in few seconds, i suggest to take that info in dynamic collection classes (i.e dynamic vectors or hash tables or linked lists)  say 1000 per class for example

2. Create the thread that adds the information in the list
3. create the instance to new thread, send the ppointer of collection object  to the thread instance and start the thread.
4. like that call all threads at a time.
5. But take care that only 10 to 20 threads (depending on system peformance) should be in running mode. i.e at any moment of time ,  application execution should only support 10 to 20 threads
6. take care of syncronization to the listbox object also (if necessary)

hope you got my ideas.


Regards,
Koundinya
0
 
LVL 2

Accepted Solution

by:
Robn earned 20 total points
ID: 9739337
are you using beginupdate and endupdate on the listview items?
If not, this will speed up the population of the list.

Regards,
Rob
0
 

Author Comment

by:Engwi
ID: 9739370
Rob

Will try that first and let you know.

Thanks
 Engwi
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 9756047
Have you considered turning the listview into a virtual listview?
0
 

Expert Comment

by:lamtl354
ID: 9761011
what is virtual listview??
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month5 days, 15 hours left to enroll

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question