473,765 Members | 2,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1023
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***@emailadr ess.com> wrote in message
news:u7******** ******@TK2MSFTN GP12.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 "AllowPagin g" property and
creating a subroutine to change the current page(you have to set the
CurrentPageInde x 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***@emailadr ess.com> wrote in message
news:u7******** ******@TK2MSFTN GP12.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******@onlin e.microsoft.com > wrote in message
news:ei******** ******@TK2MSFTN GP09.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 "AllowPagin g" property and creating a subroutine to change the current page(you have to set the
CurrentPageInde x 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***@emailadr ess.com> wrote in message
news:u7******** ******@TK2MSFTN GP12.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
2076
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 this situation: One of the forms presents the user with high-level options. Depending on the option selected, certain frames are made visible. The controls in the frames include options, checkboxes, text boxes and labels, the settings of all of...
2
3055
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 have recently detected a memory leak that we can see from "ps aux" is attributable to the Python processes. Running Sam Rushing's (http://www.nightmare.com/medusa/memory-leaks.html) get_refcounts() function does not yield any smoking guns: the...
15
3053
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 http://www.heron-language.com/aspect-cpp.html. I would appreciate some feedback on the article, and also I would like to know whether I am repeating some prior work. Thanks in advance! --
2
1181
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: http://www.bestkungfu.com/archive/?id=496 now I don't know Matt really, I managed to miss talking to him at a meeting we were both at last week, but generally the W3 and WAI folk
21
4840
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 using regular expressions to search and replace in multiple files. I also use many different copy buffers and know all the keyboard shortcuts like the back of my hand. The point is... it's comfortable. Unfortunately, it's become just too...
0
1262
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 Schematron, read up on XML design patterns and best practices, and thought I knew what I was doing. Since there was more overlap than not between the contents of the different transaction types, I designed a single schema with a single root, and...
1
2789
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 top header with a dropdown menu which does not scroll when the page is scrolled. - A lower detail part of the screen (table) where the headers stay, and
19
2301
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 dynamic binding or creating function and I understand most of that but how can I learn and employ techniques to make my programs better. I try to employ the lessons I learn in the programs that I write. Acclerated C++ is the best book I have...
13
5385
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* getInstance()
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10164
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5277
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.