博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
asp.net的一个简单简历缓存方法
阅读量:4511 次
发布时间:2019-06-08

本文共 691 字,大约阅读时间需要 2 分钟。

asp.net的一个简单简历缓存方法:

 

View Code
1 public static DataSet GetCacheTD() 2         { 3             DataSet ds = new DataSet(); 4             Cache cache = System.Web.HttpContext.Current.Cache; 5             if (cache["TDic"] == null) 6             { 7                 ds = ReadHelper.ExecuteQuery(CommandType.Text, "sqlText ", null); 8                 cache.Insert("TDic", ds, new SqlCacheDependency("数据库名称", "数据表名称")); 9             }10             else11             {12                 ds = (DataSet)cache["TDic"];13             }14             return ds;15         }

其中,这里的ReadHelper.ExecuteQuery()另外包含了数据库的连接字符和方法的,这里省略了。

转载于:https://www.cnblogs.com/Iven-zhang/archive/2013/04/23/3038285.html

你可能感兴趣的文章
利用INI文件实现界面无闪烁多语言切换
查看>>
sql语句的一种组织方法
查看>>
最精简的IOCP封装
查看>>
Jmeter-JDBC连接测试
查看>>
HDU 4344
查看>>
nyoj43 24 Point game(DFS)
查看>>
RedisTemplate操作Redis
查看>>
Android基础TOP5_2:MultiAutoCompleteTextView多文本自动补全文本框
查看>>
初识NodeJS,一个基于GoogleV8引擎的Javascript运行环境
查看>>
Selenium—获取页面的title,url;使用句柄方式切换窗口
查看>>
UIView的autoresizingMask属性
查看>>
空间索引应用
查看>>
CheckSum
查看>>
html5 context属性解释及代码实例
查看>>
codeforces A. Vasily the Bear and Triangle 解题报告
查看>>
tarjan求强连通分量
查看>>
几个机器学习上的概念
查看>>
golang——concurrency笔记
查看>>
iOS 8 by Tutorials (section2:开始自适应布局)
查看>>
git fetch 和 git pull 的区别
查看>>