yaniv Posted June 24, 2004 Posted June 24, 2004 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? Quote
Administrators PlausiblyDamp Posted June 24, 2004 Administrators Posted June 24, 2004 The error pretty much tells you what you need to do: Cache.Insert("commonsearchDS", commonsearchDS, Nothing, DateTime.MaxValue, span) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.