problem of setting cache as datatable and reading it

Posted by MyHeadHurts on Stack Overflow See other posts from Stack Overflow or by MyHeadHurts
Published on 2011-01-07T17:40:09Z Indexed on 2011/01/07 17:53 UTC
Read the original article Hit count: 207

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net