473,800 Members | 2,613 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Server DB, Home Page with multiple user controls

Hi,

I am working on an eCommerce site, and the home page is split into multiple
sections (user controls), whose data is provided from the database.
Potentially this page will be cached, but its not a user story yet, but I am
still curious to know how people might render the page on the server,
without having each user control issue its own database read query to get
its own data. Are there best practices for this type of thing these days?

Thanks,

Nick.
Nov 19 '05 #1
3 1570
The Community Starter Kit [1] take a neat approach. All of the queries
are taken care of during the begin request event, and the code stores
the query results into data objects in the Context.Items collection.

Each control on the page looks to Context.Items for the data it needs,
instead of making a query.

http://www.asp.net/Default.aspx?tabindex=8&tabid=47

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Sat, 14 May 2005 13:57:02 +0100, "Nick" <ni**@nick.nick > wrote:
Hi,

I am working on an eCommerce site, and the home page is split into multiple
sections (user controls), whose data is provided from the database.
Potentially this page will be cached, but its not a user story yet, but I am
still curious to know how people might render the page on the server,
without having each user control issue its own database read query to get
its own data. Are there best practices for this type of thing these days?

Thanks,

Nick.


Nov 19 '05 #2
Scott,

Thanks for your reply. I have spent some time looking at the code, and I
*think* I understand what is going on. From what I understand, it doesnt
quite work for me, because my site is nothing like the community site. I'm
not sure I am looking in the right places, but I think that multiple
requests to the database are happening, which is what I am trying to avoid.
I think this example is overly complicated to full understand the benefits,
because I dont think I understand the code. I can appreciate the benefits
of the user control using the Context.Items to get its data, but some other
code does the data retrieval however....hmmm

Thanks Scott.

Nick.

"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:me******** *************** *********@4ax.c om...
The Community Starter Kit [1] take a neat approach. All of the queries
are taken care of during the begin request event, and the code stores
the query results into data objects in the Context.Items collection.

Each control on the page looks to Context.Items for the data it needs,
instead of making a query.

http://www.asp.net/Default.aspx?tabindex=8&tabid=47

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Sat, 14 May 2005 13:57:02 +0100, "Nick" <ni**@nick.nick > wrote:
Hi,

I am working on an eCommerce site, and the home page is split into
multiple
sections (user controls), whose data is provided from the database.
Potentially this page will be cached, but its not a user story yet, but I
am
still curious to know how people might render the page on the server,
without having each user control issue its own database read query to get
its own data. Are there best practices for this type of thing these days?

Thanks,

Nick.

Nov 19 '05 #3
One wants to strike an *optimal* balance between trips to the database and
session memory consumption. Where that point is will vary from real-world
application to real-world application, of course. But since your stated goal
is to *minimize* roundtrips to the database [possibly at the expense of
memory consumption] then you might consider creating a Command object that
executes a stored procedure that returns multiple tables. The multiple
tables returned by the stored procedure would fill a Dataset which could be
kept in a session variable.
Timo

"Nick" <ni**@nick.nick > wrote in message
news:uh******** ******@TK2MSFTN GP10.phx.gbl...
Scott,

Thanks for your reply. I have spent some time looking at the code, and I
*think* I understand what is going on. From what I understand, it doesnt
quite work for me, because my site is nothing like the community site. I'm not sure I am looking in the right places, but I think that multiple
requests to the database are happening, which is what I am trying to avoid. I think this example is overly complicated to full understand the benefits, because I dont think I understand the code. I can appreciate the benefits
of the user control using the Context.Items to get its data, but some other code does the data retrieval however....hmmm

Thanks Scott.

Nick.

"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:me******** *************** *********@4ax.c om...
The Community Starter Kit [1] take a neat approach. All of the queries
are taken care of during the begin request event, and the code stores
the query results into data objects in the Context.Items collection.

Each control on the page looks to Context.Items for the data it needs,
instead of making a query.

http://www.asp.net/Default.aspx?tabindex=8&tabid=47

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Sat, 14 May 2005 13:57:02 +0100, "Nick" <ni**@nick.nick > wrote:
Hi,

I am working on an eCommerce site, and the home page is split into
multiple
sections (user controls), whose data is provided from the database.
Potentially this page will be cached, but its not a user story yet, but Iam
still curious to know how people might render the page on the server,
without having each user control issue its own database read query to getits own data. Are there best practices for this type of thing these days?
Thanks,

Nick.


Nov 19 '05 #4

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

Similar topics

0
1186
by: ani | last post by:
I have a questionaire page , which basically has questions with multiple choice answers. I need to accomplish paging on this and there are few questions that are gender specific. According the person who has logged in, if the person is male, i need to generate only those questions specific to males . I have a function that returns the contents of the questionaire in the form of a datatable. I have successfully displayed all the questions...
15
4498
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do computations, the only data transfered is user mouse/kbd input. It works synchronously, but somehow, when I play in client window, both client and server have 17 fps, while when playing in server window, server has 44 fps while client ...
1
1221
by: Ani | last post by:
I have a questionaire page , which basically has questions with multiple choice answers. I need to accomplish paging on this and there are few questions that are gender specific. According the person who has logged in, if the person is male, i need to generate only those questions specific to males . I have a function that returns the contents of the questionaire in the form of a datatable. I have successfully displayed all the questions...
9
2232
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see) in page_load, or elsewhere, that says page.validate, no control says "causesvalidation=true", and the AutoEventWireup is set to false. So I would think that the control's server event function would NOT execute, but it does execute right after...
10
1731
by: darrel | last post by:
I have this structure: mypage.aspx (class = mypage) myusercontro.ascx On the mypage.aspx I can declare a variable: animal = "monkey" I can read this from the UC by simply doing this: mypage.animal
9
3195
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will load with different data (locations, departments, etc.).
2
6971
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
9
1542
by: senfo | last post by:
In my not so humble opinion, Server.Transfer() looks good on paper, but I have yet to come across a use for it that couldn't be accomplished better another way. When it comes down to it, I really dislike the method because, at least at my company, it leads to bad designs. It also further irritates end users because it breaks the back button. I really wish the Server.Transfer() method would go away so people would stop using it. What...
0
9691
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
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10507
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...
1
10255
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,...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
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
5473
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
4150
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
3765
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.