473,396 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Techniques and Advice

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.

Nov 18 '05 #1
3 1008
if you dont want to load the whole set you will have to use SQl to do this.

that can be done a lot of ways but I am not aware of this range you speak
of.

IN grids you will have to use custom paging and write the range code
yourself

".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.

Nov 18 '05 #2
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.

Nov 18 '05 #3
Hi Martha,

What happens if I cannot use a data table? The database is queried, and from
the persistence layer a bunch of objects come back. Once I have these
objects, I then need to render them. It seems I need some way of requesting
a range fro an SQL query, to limit the results brought back, and to allow
the start and end range to be munged into a URL and used to query the DB.
However I dont know how to do this.

"Martha[MSFT]" <ma******@online.microsoft.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl...
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.


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kate | last post by:
I am learning VB by working on an existing application. It is dawning on me that this particular program was not designed very carefully, and I have come to the point where I have to deal with...
2
by: Adam Deutsch | last post by:
I would like to ask some advice about tracking down memory leaks in Python code. We have a python application running on Python 2.0.1 in an embedded Linux environment (kernel version 2.4.7). We...
15
by: christopher diggins | last post by:
I have written an article on how to do Aspect Oriented Programming in vanilla C++ (i.e. without language extensions or other tools such as AspectC++). The article is available at...
2
by: Jim Ley | last post by:
Hi People, The WAI (Web Accessibility Initiative) folk in the W3 are looking to get a good script techniques document, and are obviously looking for help. See Matt May: ...
21
by: dub | last post by:
Hello web folks... I've been desigining web pages for 13 years using my trusty text editor (UltraEdit) and in depth knowledge of HTML. I'm truly a text editor ninja at this point. I am frequently...
0
by: Steve Jorgensen | last post by:
I recently produced an XML Schema to support several kinds of transactions within a particular business domain. In the process, I learned pretty much all of how W3C XML Schema works, learned some...
1
by: Keimo Repo | last post by:
Hello I would need some advice, even just speculations... A customer of ours insists on a couple of customer specific design features for our existing multi-customer web application: - A...
19
by: JoeC | last post by:
I have seen many books that teack coding for C++. What are ways to improve my techniques for writing larger programs. I have written many demo programs learning some aspects of code wether it be...
13
by: JohnQ | last post by:
Why would anyone write: class SomeThing // class littered with non-domain single-instancing code :( { private: SomeThing(); static SomeThing* pInstance_; public: static SomeThing*...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.