473,581 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ 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.asa x) 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 973

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 GetGoodEnoughDa ta( bool forceRefresh )
{
string key = "myuniqueke y";
bool needToHitDataba se = false;
DataSet ds;

if(!forceRefres h)
{
if( null ==Application[key]) )
{
needToHitDataba se = true;
}
}
else
{
needToHitDataba se = true;
}
if(needToHitDat abase ==true)
{
ds = SomeBusinessObj ect.GetDataSet( );
Application[key] = ds;
}
else
{
ds = Application[key] as DataSet;
}

return ds;

}
<sh********@gma il.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
hi all,
i want to know whether we can make a dataextract function in global
page(global.asa x) 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
1573
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 they're just as new to ASP.NET as I am. Is it possible to have a dataset filled with all the records in an SQL table (on the small side, maybe three...
6
316
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 columns: Rep, Area, Period, Qty. I want to display this data on a datagrid like: Rep, Period1_Qty, Period2_Qty, .. Period7_Qty where the...
5
3682
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 XML file. Once my application starts, I load this XML file into a DataSet object using "ReadXML" function. This creates a dataset in memory with...
2
1444
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 the following line of code: ds.ReadXML(InputFileName); Against this DataSet, I need to be able to run SQL Queries, with the ultimate goal of...
2
1475
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 applied to operands of type 'string' " error does pointing to the "Act.Trim" which should be of method call syntax such as Act.Trim() After...
0
8157
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. ...
0
8312
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...
1
7914
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...
0
6564
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5683
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...
0
3809
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...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2309
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
1
1410
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.