Random Rows with the DataPager and ListView?

  • Thread starter Thread starter MU
  • Start date Start date
M

MU

Hello

I would like to implement a datapager control on my listview and
return the rows randomly. I am returning the rows with:
ORDER BY NEWID()
which gives me randomized rows but when used with the datapager, when
the user clicks on the Next button, the rows are returned randomized
again, giving me rows that were on the first page.

Is there a way to use the original random dataset instead of it
randomizing again each time the user clicks Next?

Thanks!
MU
 
Sure. You cache the dataset you originally retrieved and create a custom
pager. If you are generating IDs, you will have to make sure those ids are
added to your data objects (DataSet, LINQ, etc.). There are probably other
ways to skin this cat, as well.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Back
Top