68861

What are some database caching options for .Net?

Question:

I see on the web there are a lot of questions about caching ASP.Net, but not a lot of discussion on caching options for a Smart Client Application and their databases.

What are the data caching options that are available for Smart Client Application on the .Net framework, and how are any of you using them?

<hr />

<strong>Edit</strong>

Enterprise Framework was mentioned below, thoughts?

Answer1:

Caching frequently accessed data is required/desirable in Winforms Smart Client applications. Reading data from cache is often faster than hitting your data providers/web services.

Here are a couple of options with examples

<ol><li>Enterprise library's caching application block is a good choice.</li> <li>Also, System.Web.Caching.Cache can be used with Winforms, just get a static instance. </li> </ol>

See the example below.

With Entlib

using Microsoft.Practices.EnterpriseLibrary.Caching; //Later CacheManager cache= CacheFactory.GetCacheManager(); cache.Add("dataKey", "Yourdata")

With .NET built-in cache - This'll work for your Winform app also.

using System.Web.Caching; using System.Web; public sealed class CacheProvider { private CacheProvider(){}; public static GetInstance() { return HttpRuntime.Cache; } }

Answer2:

Well, if you have a Windows Forms application, you aren't usually concerned with the types of multi-user caching scenarios that are common in ASP.NET. I think that's why you aren't seeing a lot of documentation on the subject here.

I generally roll my own caching mechanism for Windows Forms -- just storing "cached" stuff as the application's state. Do you have any examples of a scenario where you would need it? The solution should be tailored to fit the problem...

Answer3:

<a href="http://msdn.microsoft.com/en-us/data/cc655792.aspx" rel="nofollow">Velocity</a> is another option.

Recommend

  • Login to adfs through openam using java application
  • Restrict a directory that can be used only through a .net Application
  • Is is possible to have a clean undeploy in Glassfish?
  • Admob Interstitial Ad showing black with new Ad unit ID
  • Date format change angular 2
  • Installing PySide - OSX
  • Grails redirect with reverse proxy
  • Unable to set up Android Target in Eclipse
  • How do I go about listing all of the installed packages and versions on mac os x?
  • Can't switch to database other than _system within Foxx
  • LyX — Title, Abstract, Keywords Missing When Using Elsevier Class in View
  • IE readonly textarea problem
  • IIS 7.5 404 Error for .PDF files
  • Angular2 emit event up to the DOM tree
  • how to load css classes from my own project specfic css in Sitecore's RAD editor?
  • Detecting application hangs with ActiveX controls in .Net
  • How to use SBT with multiple sub project web applications?
  • What is RSL (Runtime shared library ) used for in flash?
  • Autohotkey script running program with command line arguments
  • Mockery and Laravel constructor injection
  • Fat binaries in iOS
  • back button function for phonegap windows phone 7
  • Running jasmine tests for a component with NgZone dependency
  • Can long-polling be achieved in Restlet by just making the thread sleep?
  • Are Richfaces and Primefaces compatible with each other?
  • Retaining data after updating application
  • Request response issues in biztalk
  • Why are YouTube videos using 'youtube.com/v' not loading
  • cordova is not defined - cordova.js has already been loaded :: Ionic
  • Clear fused location provider's location for testing
  • How to suppress a dialog
  • azure media services - The request body is too large and exceeds the maximum permissible limit
  • debug library loaded with ctypes using gdb
  • Combining SpatialPolygonsDataFrame of two neighbour countries
  • Javascript simulate pressing enter in input box
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Why winpcap requires both .lib and .dll to run?
  • Revoking OAuth Access Token Results in 404 Not Found
  • Angular 2 constructor injection vs direct access
  • reshape alternating columns in less time and using less memory