Large DataSet Question

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi,

I am retrieving a dataset with over 100 records and can vary based on user
in which it can get even larger. I am displaying the dataset in a datagrid.
I was looking for reccomendations on how to breakup the dataset because I do
not want to show 100 records in a datagrid. I was thinking about limiting
the dataset to 50 records based on the a stored procedure, is that a better
idea? The stored procedure is based on a like clause which the user enters.

Thanks
 
100 rows is not that much for a DataSet (or the DataGrid). I would not worry
about it. If you don't want to show that many rows, use a DataView to filter
out some of the rows and let the user decide what they want to see.
hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
I agree about 100 rows however as time goes on it could thousands as the
database grows. I am trying to design it with the future in mind!

Thanks
 
Well, that's a good strategy. My book discusses a number of approaches you
can use to fetch just the data rows you need--just in time. Using a "LIKE"
expression is an easy way to limit rows. Create a Command object that
defines an input parameter and passes it to the SP.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Thanks for the post,

The query that the user is running is using LIKE which can return a large
datset of records based on the "LIKE" value passed in.

Thanks
 
Sure... just add "SELECT TOP n" to the query where n is a number around 100
or so. This limits the number of rows returned.



--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Is that a good approach? Or is it better to displap the top 100 and if the
user wants to see more have a button which would the next 100 and so on?

Thanks
 
There are as many approaches as there are programmers. I like the approach
of fetching 2 screens (about 50 rows) of data. When the user clicks "down"
(show me more), I show the next 25 (screen's worth) and in the background
get another 50 and repeat the process. This approach uses a combination of
TOP 50 and a WHERE clause that has the query begin retrieving rows just
after the last row fetched.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top