2014年10月29日

SQL 分页查询的四种方法

摘要: 方法一 假设现在有这样的一张表: CREATE TABLE test ( id int primary key not null identity, names varchar(20) ) 然后向里面插入大约100条数据,进行分页测试 假设页数是10,现在要拿出第5页的内容,查询语句如下: --10代表分页的大小 select ... 阅读全文

posted @ 2014-10-29 19:08 黎木 阅读(1180) 评论(0) 推荐(0) 编辑

SQL Server with(nolock)详解

摘要: 大家在写查询时,为了性能,往往会在表后面加一个nolock,或者是with(nolock),其目的就是查询是不锁定表,从而达到提高查询速度的目的。 什么是并发访问:同一时间有多个用户访问同一资源,并发用户中如果有用户对资源做了修改,此时就会对其它用户产生某些不利的影响,例如: 1:脏读,一个用户对一个资源做了修改,此时另外一个用户正好读取了这条被修改的记录,然后,第一个用户放弃修改,数据回到修... 阅读全文

posted @ 2014-10-29 13:42 黎木 阅读(10202) 评论(1) 推荐(5) 编辑

WCF 删除队列

摘要: Configuration config = ConfigurationManager.OpenExeConfiguration (ConfigurationUserLevel.None); ServiceModelSectionGroup group=ServiceModelSectionGroup.GetSectionGroup(... 阅读全文

posted @ 2014-10-29 11:40 黎木 阅读(282) 评论(0) 推荐(0) 编辑

扩展方法检测客户端队列是否存在

摘要: public static class QeuedServiceHelper { public static void VerifyQeues() { Configuration config = ConfigurationManager.OpenExeConfiguration (Configu... 阅读全文

posted @ 2014-10-29 11:23 黎木 阅读(209) 评论(0) 推荐(0) 编辑

WCF宿主端检验队列

摘要: ServiceHost host = new ServiceHost(typeof(Service1)); if (MessageQueue.Exists(@".\private\MyMessageQueue") == false) { MessageQueue.Create(@".\pr... 阅读全文

posted @ 2014-10-29 10:39 黎木 阅读(211) 评论(0) 推荐(0) 编辑

C# 遍历枚举类

摘要: framework 4.0 环境下方法定义枚举类判断枚举类中是否存在,若存在则输出例子:Defined.QrCode.QrCodeType type;//枚举类if (!Enum.TryParse( aa,out type)){ context.Response.Write("枚举类不存在"... 阅读全文

posted @ 2014-10-29 10:04 黎木 阅读(947) 评论(0) 推荐(0) 编辑

Sql 随机更新一条数据返回更新数据的ID编号

摘要: DECLARE @parimaryTable(临时表) Table(prizecode varchar(50)); update top (1) 数据表 set 字段a='数值' ,字段b=‘数值’ output deleted.prizecode into @parimaryTable(临时表) ... 阅读全文

posted @ 2014-10-29 09:49 黎木 阅读(974) 评论(0) 推荐(1) 编辑

导航