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