Click here to Skip to main content
15,899,937 members
Home / Discussions / C#
   

C#

 
GeneralRe: At commands in c# Pin
Roger Wright25-May-11 19:54
professionalRoger Wright25-May-11 19:54 
Questioncaching data on server in windows application in c# Pin
siva45524-May-11 18:52
siva45524-May-11 18:52 
AnswerRe: caching data on server in windows application in c# Pin
Subin Mavunkal24-May-11 22:00
Subin Mavunkal24-May-11 22:00 
GeneralRe: caching data on server in windows application in c# Pin
Richard MacCutchan24-May-11 23:32
mveRichard MacCutchan24-May-11 23:32 
AnswerRe: caching data on server in windows application in c# Pin
Eddy Vluggen25-May-11 0:18
professionalEddy Vluggen25-May-11 0:18 
AnswerRe: caching data on server in windows application in c# Pin
Pete O'Hanlon25-May-11 0:46
mvePete O'Hanlon25-May-11 0:46 
GeneralRe: caching data on server in windows application in c# Pin
siva45525-May-11 2:03
siva45525-May-11 2:03 
GeneralRe: caching data on server in windows application in c# Pin
Pete O'Hanlon25-May-11 2:19
mvePete O'Hanlon25-May-11 2:19 
You have hosted this in a web server then? If so, you simply need to use a pattern like this:
C#
private MyData GetData()
{
  HttpCache myCache = HttpContext.Current.Cache;
  MyData data = myCache["MyData"];
  if (data == null) return GetDataAndStoreInCache();
  return data;
}

private MyData GetAndStoreInCache()
{
  // Do something to get the data.
  MyData data = RetrieveDataHere();
  HttpContext.Current.Cache.Insert("MyData", data, null, DateTime.Now.AddHours(6), TimeSpan.Zero);
  return data;
}

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: caching data on server in windows application in c# [modified] Pin
siva45525-May-11 19:02
siva45525-May-11 19:02 
GeneralRe: caching data on server in windows application in c# Pin
Pete O'Hanlon25-May-11 21:44
mvePete O'Hanlon25-May-11 21:44 
AnswerRe: caching data on server in windows application in c# Pin
Luc Pattyn25-May-11 1:30
sitebuilderLuc Pattyn25-May-11 1:30 
AnswerRe: caching data on server in windows application in c# Pin
PIEBALDconsult25-May-11 2:50
mvePIEBALDconsult25-May-11 2:50 
AnswerRe: caching data on server in windows application in c# Pin
jschell25-May-11 10:16
jschell25-May-11 10:16 
QuestionTFS GetEffectivePermission and TF14014: Cannot query effective item or global permissions for other users. Pin
devvvy24-May-11 16:26
devvvy24-May-11 16:26 
QuestionWorking with multiple values in one field in an Access database Pin
Matt U.24-May-11 11:50
Matt U.24-May-11 11:50 
AnswerRe: Working with multiple values in one field in an Access database PinPopular
Paladin200024-May-11 12:12
Paladin200024-May-11 12:12 
GeneralRe: Working with multiple values in one field in an Access database Pin
Matt U.24-May-11 13:36
Matt U.24-May-11 13:36 
GeneralRe: Working with multiple values in one field in an Access database Pin
V.25-May-11 1:33
professionalV.25-May-11 1:33 
AnswerRe: Working with multiple values in one field in an Access database Pin
Roger Wright25-May-11 19:39
professionalRoger Wright25-May-11 19:39 
Questionconcatenate the word document, it's possible? Pin
abbd24-May-11 7:03
abbd24-May-11 7:03 
AnswerRe: concatenate the word document, it's possible? Pin
Eddy Vluggen25-May-11 0:19
professionalEddy Vluggen25-May-11 0:19 
AnswerRe: concatenate the word document, it's possible? Pin
Alan N25-May-11 2:05
Alan N25-May-11 2:05 
AnswerRe: concatenate the word document, it's possible? Pin
Dave Kreskowiak25-May-11 2:59
mveDave Kreskowiak25-May-11 2:59 
GeneralRe: concatenate the word document, it's possible? Pin
Alan N25-May-11 4:06
Alan N25-May-11 4:06 
GeneralRe: concatenate the word document, it's possible? Pin
Dave Kreskowiak25-May-11 6:22
mveDave Kreskowiak25-May-11 6:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.