S
sklett
Hi-
I am having a hard time decided where I should be implementing my Cache
code. I store most of the DataSet's that I need in the Cache. I was doing
it in the bind method of my pages, but then I thought it would be cleaner to
maybe at the Cache code directly in the DAL. So, for example I might have a
DAL method to get products that looks like this:
public DataSet GetProducts()
{
if(Cache["prodData"])
{
return (DataSet)Cache["prodData"];
}
else
{
DataSet dsBuff;
//.... code to get stuff from the DB - fill the dsBuff with it
Cache["prodData"] = dsBuff;
return dsBuff;
}
}
(that was not real code, I just typed it, so if there are typos.. please
disgregard)
I'm curious if this is how you guys are doing things? Is there anything
wrong with doing it this way?
your thoughts please...
- Steve
I am having a hard time decided where I should be implementing my Cache
code. I store most of the DataSet's that I need in the Cache. I was doing
it in the bind method of my pages, but then I thought it would be cleaner to
maybe at the Cache code directly in the DAL. So, for example I might have a
DAL method to get products that looks like this:
public DataSet GetProducts()
{
if(Cache["prodData"])
{
return (DataSet)Cache["prodData"];
}
else
{
DataSet dsBuff;
//.... code to get stuff from the DB - fill the dsBuff with it
Cache["prodData"] = dsBuff;
return dsBuff;
}
}
(that was not real code, I just typed it, so if there are typos.. please
disgregard)
I'm curious if this is how you guys are doing things? Is there anything
wrong with doing it this way?
your thoughts please...
- Steve