2013年7月2日
摘要: /// /// DES加密/解密类。 /// public class DESEncrypt { #region ========加密======== /// /// 加密 /// /// /// public static string Encrypt(string Text) { return Encrypt(Text, "Www.EasaA.Com"); } /// /// ... 阅读全文
posted @ 2013-07-02 11:27 LitDev 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 公司有做一个手机统计的饼状图后台读取数据时频繁的读取xml进行匹配(手机品牌和型号都是放到xml中),频繁的load xml无疑会增加整个页面的加载时间项目经理教我使用单例模式,仅需要一次load xml,就可以在全局中使用,类似于Application或Session首先,建一个公共的类DataService.csprivate static DataService instance; private DataService() { } public XmlDocument xmldoc_MobileBrand; public XmlDocument... 阅读全文
posted @ 2013-07-02 11:25 LitDev 阅读(525) 评论(0) 推荐(0) 编辑
  2013年5月29日
摘要: 表结构如下:每个用户每天只能签到一次现在前面的需求是判断某个用户在某天是否是连续签到,使用sql中的递归来实现with currentDateCTE AS ( -- 当前天. SELECT * FROM dt_Signin WHERE user_id = 270 and CONVERT(DATE, sign_time) = CONVERT(DATE, '2013-05-16 22:15:32.670')--这就是需求中的某天),prevDateCTE AS ( -- 向前递归. SELECT * FROM currentDateCTE UNION ALL SELECT prev 阅读全文
posted @ 2013-05-29 15:56 LitDev 阅读(4755) 评论(0) 推荐(0) 编辑
  2012年11月28日
摘要: like查询效率低下,网上搜了一下替代like查询的方法,都是说用charindex方法,自己对比了一下查询速度test1表中有一千两百多万条数据,我只给ID加了索引先看一下 '%我%'这种模糊查询:declare @q datetimeset @q = getdate()select ID,U_Name,U_Sex,U_Age,U_Address from test1 where U_Name like '%我%'select [like执行花费时间(毫秒)]=datediff(ms,@q,getdate())declare @w datetimeset @w 阅读全文
posted @ 2012-11-28 23:01 LitDev 阅读(12737) 评论(3) 推荐(4) 编辑
摘要: 上一篇博客对比了not in 和 max\min分页的效率,这次来看看row_number分页效率如何在网上扒了一个row_number的分页存储过程,源地址:http://bbs.csdn.net/topics/300185125,在这里稍加修改,使之更加灵活create proc Proc_TablePage--表名@tablename nvarchar(20),--查询字段@selcolumn nvarchar(1000),--排序字段@sortcolumn nvarchar(255),--每页记录数@pagecount int,--页号@pageindex intasdeclar... 阅读全文
posted @ 2012-11-28 22:33 LitDev 阅读(692) 评论(1) 推荐(0) 编辑
摘要: 先看下表中共有多少条数据:一百二十多万条,呵呵。sql语句:declare @d datetimeset @d = getdate()select top 10 ID,U_Name,U_Age,U_Sex,U_Address from Test1 where ID not in (select top 9990 ID from Test1 order by ID) order by ID select [not in方法升序分页执行花费时间(毫秒)]=datediff(ms,@d,getdate()) declare @s datetimeset @s = getdate()select to 阅读全文
posted @ 2012-11-28 22:02 LitDev 阅读(1272) 评论(0) 推荐(0) 编辑
  2012年11月19日
摘要: declare @d datetimeset @d = getdate()select top 10 U_Name from Test1 where ID not in (select top 30 ID from Test1 order by ID desc) order by ID descselect [语句执行花费时间(毫秒)]=datediff(ms,@d,getdate()) go 阅读全文
posted @ 2012-11-19 18:31 LitDev 阅读(388) 评论(0) 推荐(0) 编辑
摘要: declare @i intset @i = 1while @i<100000beginexec Proc_InsertTest1 '测试使用数据',20,'男','地球村'set @i = @i+1end 阅读全文
posted @ 2012-11-19 18:29 LitDev 阅读(189) 评论(0) 推荐(0) 编辑
  2012年11月7日
摘要: simplemodal官方地址:http://www.ericmmartin.com/projects/simplemodal/,下面是我测试的一个简单弹出层,在项目开发中,操作消息提示使用alert始终不好,所以找了这个插件来取代alert,在此将官方源码整理一下下载源码后将basic\js\jquery.simplemodal.js(jquery本身js文件随便拷贝一个就行,我用的是VS10中自带的1.4)、basic\img\basic\x.png和basic\css\basic.css文件拷到项目下文件头部引用:<link href="css/basic.css&quo 阅读全文
posted @ 2012-11-07 18:01 LitDev 阅读(3828) 评论(0) 推荐(0) 编辑
  2012年11月6日
摘要: 一同事找的这个控件,觉得挺不错的,到官方(http://www.access2008.cn/)下载源码后稍加修改html页面代码:<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh_cn" lang="zh_cn"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>多文件上传组 阅读全文
posted @ 2012-11-06 14:57 LitDev 阅读(3961) 评论(1) 推荐(2) 编辑