Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Caching In C# Application

Caching In C# Application

Scheduled Pinned Locked Moved C#
questioncsharp
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MicSky
    wrote on last edited by
    #1

    Is it possible to use Cache in a windows form application? if yes, how do i do that? pls advice...

    D 1 Reply Last reply
    0
    • M MicSky

      Is it possible to use Cache in a windows form application? if yes, how do i do that? pls advice...

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Sure. But the methods used depend entirely on what your trying to cache. RageInTheMachine9532

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Sure. But the methods used depend entirely on what your trying to cache. RageInTheMachine9532

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Basically values from the database that has been stored into a hashtable... this hashtable will then later be inserted into a cache... i have tried doing it in asp.net by using System.Web; using System.Web.Caching to enable the use of Cache. so now i m actually wondering whether this could be used in a windows form application. can a windows form application call to this cache...?

        M D 2 Replies Last reply
        0
        • A Anonymous

          Basically values from the database that has been stored into a hashtable... this hashtable will then later be inserted into a cache... i have tried doing it in asp.net by using System.Web; using System.Web.Caching to enable the use of Cache. so now i m actually wondering whether this could be used in a windows form application. can a windows form application call to this cache...?

          M Offline
          M Offline
          Marcie Jones
          wrote on last edited by
          #4

          Hi, One way is to use the Caching Application Block: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/Cachingblock.asp Marcie http://www.codeproject.com

          1 Reply Last reply
          0
          • A Anonymous

            Basically values from the database that has been stored into a hashtable... this hashtable will then later be inserted into a cache... i have tried doing it in asp.net by using System.Web; using System.Web.Caching to enable the use of Cache. so now i m actually wondering whether this could be used in a windows form application. can a windows form application call to this cache...?

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            You could use the Web.Caching class to do what you want. If your app isn't web based, you might also want to look at this MSDN .NET Caching Guide[^] for some other ideas. RageInTheMachine9532

            A 1 Reply Last reply
            0
            • D Dave Kreskowiak

              You could use the Web.Caching class to do what you want. If your app isn't web based, you might also want to look at this MSDN .NET Caching Guide[^] for some other ideas. RageInTheMachine9532

              A Offline
              A Offline
              Anonymous
              wrote on last edited by
              #6

              Yeah the application that i m doing isn't web based... For web based, i implemented something like this... // Global Declaration private Cache m_Cache; // Constructor m_Cache = HttpRuntime.Cache; // The implementation if ( m_Cache["Sql"] == null ) { /* 1. Get Data To Be Cached From Database Into A DataSet 2. Insert DataSet To HashTable 3. Insert HashTable to m_Cache */ } else { /* Get The Required HashTable From Cache */ } But then for my Windows Forms Application ( Isn't Web Based ), i wanna do it something like how i did it with the HttpRuntime.Cache but then i can't coz i don't wanna use Web.Caching Class. I know that by using Hashtable is already a form of caching, but how do i initialize a Hashtable for a runtime cache? i mean something like this... // Global Declaration private Hashtable m_Hashtable; // Constructor m_Hashtable = HttpRuntime.Cache; // Which is impossible coz i m not using Web.Caching Class. Pls Advice...

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups