my cached dataset just wont stay cached!!

C

Craig G

is there something im doing wrong??

the dataset is cached up until i click a button then when i try to retrieve
it, it justs says its nothing!!

this is code where it gets inserted into the cache

Cache.Insert("myDS", dsResults, Nothing,
System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(300))
now if i query the cached dataset it shows that there is data in it!!

but once i click my button and this code for the click button runs to try to
retrieve it - it comes back saying the dsResults is 'nothing'

Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSearch.Click
Dim strCode As String = txtCode.Text
Dim strDescription As String = txtDescription.Text
Dim strFilter As String
Dim drFilteredRows As DataRow()
Dim dtDataTable As New DataTable
Dim dsResults As DataSet

dsResults = CType(Cache.Item("myDS"), DataSet)
strFilter = "Code='" & strCode & "' AND Description='" & strDescription &
"'"
drFilteredRows = dsResults.Tables(0).Select(strFilter)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top