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