problem of setting cache as datatable and reading it
- by MyHeadHurts
and this is how i see if my cache is empty
all my syntax errors are coming when i am trying to see if the cache is null and if it is to run the stored procedure
If RadioButtonList1.SelectedIndex = 0 Then
If Cache["netcache"] = null Then
bcmd.CommandText = "yearlynetsales"
Else
btable = cache["netcache"]
end if
If RadioButtonList1.SelectedIndex = 1 Then
If Cache["salescache"] = null Then
bcmd.CommandText = "yearlysales"
Else
btable = cache["salescache"]
end if
end if
this is how i set my cache
If RadioButtonList1.SelectedIndex = 0 Then
Cache.Insert("netcache", bTable)
ElseIf RadioButtonList1.SelectedIndex = 1 Then
Cache.Insert("salescache", bTable)
ElseIf RadioButtonList1.SelectedIndex = 2 Then
Cache.Insert("cxsalescache", bTable)
ElseIf RadioButtonList1.SelectedIndex = 3 Then
Cache.Insert("cxvaluecache", bTable)
ElseIf RadioButtonList1.SelectedIndex = 4 Then
Cache.Insert("othersalescache", bTable)
ElseIf RadioButtonList1.SelectedIndex = 5 Then
Cache.Insert("inssalescache", bTable)
End If