What are some of the database caching options for .Net?

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

What are the data caching options available for Smart Client in .NET and how do you use them?


Edit

The corporate basis has been mentioned below, thoughts?

+1


source to share


3 answers


In Winforms Smart Client applications, it is required / desirable to cache frequently accessed data. Reading data from cache is often faster than hitting your data / web service providers.

Here are some options with examples

  • The enterprise application caching app block is a good choice.
  • Also, System.Web.Caching.Cache can be used with Winforms, just get a static instance.

See example below.



With Entlib

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

      

With built-in .NET cache. This will work for your Winform application as well.

using System.Web.Caching;
using System.Web;

public sealed class CacheProvider 
{ 
    private CacheProvider(){}; 

    public static GetInstance() 
    {  
            return HttpRuntime.Cache;
    } 
}

      

+2


source


Well, if you have a Windows Forms application, you are usually not interested in the types of multi-user caching scripts that are common across ASP.NET. I think you don't see a lot of documentation here on the subject.



I usually run my own Windows Forms caching engine - just storing the "cached" stuff as application state. Do you have examples of the scenario you need? The solution must be adapted to address this problem ...

0


source


Velocity is another option.

0


source







All Articles