my cached dataset just wont stay cached!!

Discussion in 'ASP .Net' started by Craig G, Mar 7, 2005.

  1. Craig G

    Craig G Guest

    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)
    Craig G, Mar 7, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ALPO

    Paging against cached dataset

    ALPO, Nov 24, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    307
  2. DJS2C
    Replies:
    4
    Views:
    476
    DJS2C
    Dec 21, 2004
  3. Jeppe Jespersen
    Replies:
    3
    Views:
    715
    Jeppe Jespersen
    Jul 10, 2007
  4. azrael
    Replies:
    1
    Views:
    272
    azrael
    Oct 12, 2008
  5. PJ6
    Replies:
    1
    Views:
    317
    Gregory A. Beamer
    Aug 12, 2009
Loading...

Share This Page