如果创建SQL 虚拟表 C#里如果使用 意思就是我现在SQL里有100W条数据。我现查出1W条来用。。但我这1W条经常用到。。我想把写到内存里。。如果在某时间里没有用就自动消失。。一有人用就创建就像MY SQL 里的一样` 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用Cache来解决先把1W条数据存到Table里,然后再判断Cache,里面有值就调用Cache,无值就插入.例子public DataSet GetUserList(int UserID) { /* * 写入缓存 * */ string key = string.Concat("GetUserAdminLeft_", UserID); object obj = HttpRuntime.Cache.Get(key); DataSet ds = new DataSet(); if (obj == null) { ds = new project.SqlServer.Users().GetUserList(UserID); HttpRuntime.Cache.Insert(key, ds, null, DateTime.Now.AddMinutes(min), TimeSpan.Zero); } else { ds = (DataSet)obj; } return ds; } html生成word,怎么控制行间距 插入<img>后,<td>自动变高了 求孟子,以及各位高手帮忙。问题不难,但我就是不会~ 自动上传某个客户端的特定文件,而不需要用户选择文件,怎么做? 上傳時Excel中有的數字自動轉為科學計數法,有解法嗎?急 禁止往<input type="text">控件里复制内容,请问用JAVASCRIPT怎么写? asp.net 怎么解决页面闪的问题? 求助:VB.NET+ASP.NET做动态菜单 有没有关于Request对象的详细的说明文档,在.net中,请指教 超连接能打开本地的文件夹么 GridView绑定Table的特定列的问题
先把1W条数据存到Table里,然后再判断Cache,里面有值就调用Cache,无值就插入.
例子public DataSet GetUserList(int UserID)
{
/*
* 写入缓存
* */
string key = string.Concat("GetUserAdminLeft_", UserID);
object obj = HttpRuntime.Cache.Get(key);
DataSet ds = new DataSet();
if (obj == null)
{
ds = new project.SqlServer.Users().GetUserList(UserID);
HttpRuntime.Cache.Insert(key, ds, null, DateTime.Now.AddMinutes(min), TimeSpan.Zero);
}
else
{
ds = (DataSet)obj;
} return ds; }