I"m trying to create new cache using this code:
but i"m getting error massege:
absoluteExpiration must be DateTime.MaxValue or slidingExpiration must be timeSpan.Zero.
what i do wrong?
Code:
Dim wnDS As New DataSet()
Dim cmd As New SqlCommand()
Dim odatareader As New SqlDataAdapter()
Dim span As New TimeSpan(24, 0, 0)
If Cache("commonsearchDS") Is Nothing Then
Dim commonsearchDS As New DataSet()
commonsearchDS.Tables.Add("commonsearch")
cmd = New SqlCommand("SELECT TOP 4 * FROM tbl_searchwords ORDER BY times DESC, ID", oConnection)
odatareader = New SqlDataAdapter(cmd)
odatareader.Fill(commonsearchDS.Tables("commonsearch"))
oConnection.Close()
Cache.Insert("commonsearchDS", commonsearchDS, Nothing, Nothing, span)
Else
wnDS = Cache("commonsearchDS")
End If
but i"m getting error massege:
absoluteExpiration must be DateTime.MaxValue or slidingExpiration must be timeSpan.Zero.
what i do wrong?