I've got collection of 50k records, and i get it in one second, but loadi开发者_如何学Cng it to database take about 10 seconds.
How to increase loading data?
Everything what I make now is:
dgvCars.DataSource=cars;
Data-binding 50k rows is going to take a while. I would first look at reducing the data volume (what is any user really going to do with 50k rows). But otherwise: "virtual mode" (what | how).
Edit; I suspect most of the time is being spent doing things like building control trees and other structures, but it might be that the reflection-based member-access is slowing this down; if so, maybe HyperDescriptor could help (simply by adding a 1 line call in your code to enable it for the associated type).
Its typically more work, but you might look into asynchronous querying. Its more work, but as you can get a subset batch of data back, display it to the grid. Then on continued background results getting returned, just add to the underlying table being displayed in the grid on an as needed basis. Don't worry about pulling the full 50k records down.
精彩评论