Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I"m trying to create new cache using this 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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...