You can use a DataGrid control. You can bind a data source to a DataGrid and
it will automatically display the data records in your ASP.NET page. If you
don't want to display all the records at once, it has support for PAGING
THROUGH the records of a data source.
You enable paging for a DataGrid by enabling the "AllowPaging" property and
creating a subroutine to change the current page(you have to set the
CurrentPageIndex of your control and bind the dataGrid again). The other
important requirement for enabling paging is that your DataGrid control's
data source must implement the ICollection interface. A "DataReader"
DOESN'T implement this interface, so you have to use a "DataTable".
Of course, you can control the number of records to display (use the
"PageSize" attribute of your DataGrid).
Hope this helps,
Martha
".NET/C# User" <va***@emailadress.com> wrote in message
news:u7**************@TK2MSFTNGP12.phx.gbl...
I am working on a project that is heavily object oriented, and we are all
new to .NET. I am trying to do some research on best practice/patterns
for reading many records, and paging the data etc. I get the feeling people
will just use DataReaders maybe. But our problem is that the system is
ASP.NET, and we need some way of asking for a bunch of records between a
range. For example, say I know there are 500,000 records in a table I
need to render in IE, I dont want to load all of these records as objects and
then render the first 20. I seem to remember there were some techniques
on doing this by specifying a range.
Thanks for any advice.