Re: Large DataSet Question by William
William
Mon Jun 21 14:35:01 CDT 2004
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.
__________________________________
"Mike" <mike@noemail.com> wrote in message
news:ebFeSC7VEHA.2520@TK2MSFTNGP12.phx.gbl...
> 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
>
> "William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in message
> news:uh6DJv6VEHA.1048@tk2msftngp13.phx.gbl...
> > 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.
> > __________________________________
> >
> > "Mike" <mike@noemail.com> wrote in message
> > news:O9ljVp6VEHA.556@tk2msftngp13.phx.gbl...
> > > 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
> > >
> > > "William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in message
> > > news:O6IRFrxVEHA.1048@tk2msftngp13.phx.gbl...
> > > > 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.
> > > > __________________________________
> > > >
> > > > "Mike" <mike@noemail.com> wrote in message
> > > > news:OKHydLYVEHA.2520@TK2MSFTNGP12.phx.gbl...
> > > > > 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
> > > > >
> > > > > "William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in
> message
> > > > > news:ukVAHNXVEHA.2692@TK2MSFTNGP09.phx.gbl...
> > > > > > 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.
> > > > > > __________________________________
> > > > > >
> > > > > > "Mike" <mike@noemail.com> wrote in message
> > > > > > news:u6UTD9WVEHA.2992@TK2MSFTNGP12.phx.gbl...
> > > > > > > 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
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>