G
Guest
I hope this doesn't sound too silly. I am trying to cache a datatSet. I have
written the code below.
I insert into the cache:
Eg. i = 1.
if (Cache["testQuestion"+ i] == null)
{
Cache.Insert("testQuestion"+ i, ds.Tables);
}
retrieve from the cache:
DataSet ds2 = (DataSet)Cache["testQuestion"+ (int)ViewState["QnNo"]];
if (ds2 != null)
{
ds2 = (DataSet)Cache["testQuestion"+ (int)ViewState["QnNo"]];
MyRepeater.DataSource = ds.Tables[(int)ViewState["QnNo"]];
MyRepeater.DataBind();
}
Is there a problem there ?
TIA.
written the code below.
I insert into the cache:
Eg. i = 1.
if (Cache["testQuestion"+ i] == null)
{
Cache.Insert("testQuestion"+ i, ds.Tables);
}
retrieve from the cache:
DataSet ds2 = (DataSet)Cache["testQuestion"+ (int)ViewState["QnNo"]];
if (ds2 != null)
{
ds2 = (DataSet)Cache["testQuestion"+ (int)ViewState["QnNo"]];
MyRepeater.DataSource = ds.Tables[(int)ViewState["QnNo"]];
MyRepeater.DataBind();
}
Is there a problem there ?
TIA.