473,473 Members | 1,415 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

QUERYING THE DATASET

hi all,
i want to know whether we can make a dataextract function in global
page(global.asax) though a query and.. then for each individual .aspx
page can we query tht dataset instead of creating dataset for each page
individual page???
i'll appriciate ur help
regards
AJAY

Jul 20 '06 #1
1 964

I would suggest something like below.

It will put an object in the Application scope.... if it doesn't exist, it
hits the db.
If it exists , it returns the cached copy.
If you pass a "true" to it, it refreshes the data.

public DataSet GetGoodEnoughData( bool forceRefresh )
{
string key = "myuniquekey";
bool needToHitDatabase = false;
DataSet ds;

if(!forceRefresh)
{
if( null ==Application[key]) )
{
needToHitDatabase = true;
}
}
else
{
needToHitDatabase = true;
}
if(needToHitDatabase ==true)
{
ds = SomeBusinessObject.GetDataSet();
Application[key] = ds;
}
else
{
ds = Application[key] as DataSet;
}

return ds;

}
<sh********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
hi all,
i want to know whether we can make a dataextract function in global
page(global.asax) though a query and.. then for each individual .aspx
page can we query tht dataset instead of creating dataset for each page
individual page???
i'll appriciate ur help
regards
AJAY

Jul 21 '06 #2

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

Similar topics

3
by: MDB | last post by:
I'd normally Google for a question like this, and hope to snag a few examples along with the answer, but this time I can't see to get the keywords specific enough. Or I'd ask coworkers, but...
6
by: Fred | last post by:
I want to use a dataset so that I can obtain data from a number of sources and put it into one table. Using dataadaptors this seems to work well. Now I have a table (Forecast) in the dataset with...
5
by: sql_er | last post by:
Guys, I have an XML file which is 233MB in size. It was created by loading 6 tables from an sql server database into a dataset object and then writing out the contents from this dataset into an...
2
by: Peter Savas | last post by:
I am new to programming in C#, but have been a VB coder for 16 years, and am facing a problem which I could use some help with: I have an XML file which I am reading into a C# DataSet object with...
2
by: Steven Cheng [MSFT] | last post by:
Hi Cj, I also noticed that the "Act" variable here seems hasn't been declared(or declared anywhere else?). I've try building the same code and got the same result and the "Operator '+' cannot be...
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
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,...
0
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...
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
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...
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
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.