Large # of rows, display on demand?

  • Thread starter Thread starter Lucas Graf
  • Start date Start date
L

Lucas Graf

I have a huge amount of data being retrieved from my database (currently
85,000 rows and growing), the ability to view and manipulate ALL this data
won't happen very often, but when it does it is already becoming a long
waiting game.

Currently I am getting the data form the server via a sqlDataReader, then
going row by row and populating a DataTable which I bind to an Infragistics
WindGrid so I can use the WinGrid functionality to sort, group by etc.

This process currently takes about 1/2 seconds to get the data from the
server, and 1 to 3 minutes to populate the DataTable.

So, my question is this....
Is there a way to get the data from the server in some fashion where I can
then show in the grid only the data that needs to be currently viewed,
thereby cutting out the need to loop through all the rows and fill the
datatable. The WinGrid already has the events to request the data needed, I
just need to find a way to get that data requested.
 
I had a similar problem.

The biggest chunk of the time is probably being spent in the databinding
process.

One thing - if you don't need databinding, don't use it, but that might not
be the case in your case.
What I did was, I let the user type in the first letter of the patient name
(my specific case), and then executed a firstletter% like query to retreive
results faster.

- Sahil Malik
You can reach me thru my blog http://www.dotnetjunkies.com/weblog/sahilmalik
 
I think you should use DataSet instead of reading data one row at a time
from
the server. then bind this DataSet to a datagrid.

Use paging to limit the data retrieved from the server, you can try the
DataAdapter's
Fill() method of limiting the number of records returned. But it's not the
most efficient
way, because Fill() retrieve all the data before filtering it.

You can write your own paging function, using sql query and ado.net.
or you can use sql's TOP 10 or get the most recent data by date or month,
etc.

Also, some 3rd. party controls might have so many functionalities it slows
down the
overall performance.
 
Back
Top