I have a dataset Cache("Data") = DataSet11 how do i check if cache has data or not? say if cache("Data")=nothing then....? but this throws exception System.InvalidCastException: Operator is not valid for type 'DataSet' and 'Nothing'. at Microsoft.VisualBasic.CompilerServices.ObjectType.ThrowNoValidOperator(Object
obj1, Object obj2) at Microsoft.VisualBasic.CompilerServices.ObjectType.ObjTst(Object o1, Object o2, Boolean TextCompare) how do i check else??
or in C#, I usually grab the cache data first, then check.. so you don't have to access the cache again to use the values ALWAYS CHECK THE CACHE! DataSet myDataSet = Cache["Data"]; if (myDataSet == null) // You have to use DOUBLE = , which is the equals to
operator.. { // process myDataSet } else { // populate myDataSet manually // Cache["Data"] = myDataSet; }
priya_amb
Member
145 Points
29 Posts
check cached dataset
Apr 09, 2004 10:38 AM|LINK
joteke
All-Star
46284 Points
6896 Posts
ASPInsiders
MVP
Re: check cached dataset
Apr 09, 2004 11:15 AM|LINK
If Cache("Data") Is Nothing Then 'Nothing there Else 'Something there End IfTeemu Keiski
Finland, EU
gooberdlx
Member
265 Points
53 Posts
Re: check cached dataset
Apr 09, 2004 02:53 PM|LINK