VB Code:
Dim MyData As DataSet
'code here to populate MyData
Dim DataIWant As DataSet
If Me.Cache.Item("DATA") Is Nothing Then
DataIWant = MyData
Else
DataIWant = CType(Me.Cache.Item("DATA"), DataSet)
End If
'code to use DataIWant
As you can see REGARDLESS if the data is cached or not, the code still gets the data from the DB. This will happen everytime.
VB Code:
Dim DataIWant As DataSet
If Me.Cache.Item("DATA") Is Nothing Then
'code here to populate DataIWant
Me.Cache.Item("DATA") = DataIWant
Else
DataIWant = CType(Me.Cache.Item("DATA"), DataSet)
End If
'code to use DataIWant
The tutor didn't understand what I had done, and then said "yes, ok, but the MS code works"....errrr...*SIGH*, yea the app works, but it doesn't deal with caching correctly does it.