• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






iwteih

淡泊以修身,宁静以养性
 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 4 5 6 7 8 9 下一页

2010年1月18日

Unit Test中的config file
摘要: 给工程做unit test,其中涉及到数据访层,直接debug或run test 会失败,因为无法获得连接字串信息。 一种解决方法如下: 右键Unit Test工程,add new item -> Application Configuration File, 保留默认名字app.config, 把工作中config file里的内容copy进来;然后右键app.config,在Copy t... 阅读全文
posted @ 2010-01-18 10:46 iwteih 阅读(225) 评论(0) 推荐(0)
 
!= and == vs. !== and ===
摘要: A common mistake that developers are susceptible to is the lack of understanding of falsevalues in JavaScript. In JavaScript, null, 0, ‘’, false, and undefined are all equal (==) to eachother, since t... 阅读全文
posted @ 2010-01-18 10:45 iwteih 阅读(168) 评论(0) 推荐(0)
 
Object转化成JSON字符串
摘要: 有关JSON的介绍,请参见http://www.json.org/json-zh.html对于一个类,其中可能包括field, property,方法不做JSON序列化。我们可以去field和property进行JSON转化。模仿反射中的FieldInfo和PropertyInfo, 两者都继承于MemberInfo,我们定义三个类,用来存储field,property的信息: JsonMembe... 阅读全文
posted @ 2010-01-18 10:43 iwteih 阅读(1247) 评论(0) 推荐(0)
 
Expression Tree Picture
摘要: 图。。。 阅读全文
posted @ 2010-01-18 10:33 iwteih 阅读(144) 评论(0) 推荐(0)
 
MSMQ稍复杂的包装类
摘要: 继MSMQ简单包装类后,又把MSMQ再更新了一下。主要加入一些事件,有消息到达时,可用外部事件处理(ProcessMessageHandler),以及消息格式不是预期格式时的事件(InvalidTypeHandler),设置接收超时时间(Timeout);MSMQ里没有消息或接收超时的处理事件(NoMessageOrTimeoutHandler);可以设置接受到消息后是同步执行(ThreadCou... 阅读全文
posted @ 2010-01-18 10:31 iwteih 阅读(669) 评论(0) 推荐(1)
 
查找表中重复数据
摘要: 查找表中重复数据:select * from channel where channelname in ( select channelname from channel group by channelname having (count(*) > 1) ) 查找channel表中channelname重复的所有数据。having也是很有用的啊 阅读全文
posted @ 2010-01-18 10:27 iwteih 阅读(236) 评论(0) 推荐(0)
 
在 SQL Server 中使用 Transact-SQL如何遍历一个结果集
摘要: there are can use to iterate through result set by using Transact-SQL statements three methods。 一种方法是使用 临时 表。 使用此方法,您创建初始 SELECT 语句的"快照"并将其用作基础的"指针"。 例如: /********** example 1 **********/ declare @au_id char( 11 )set rowcount 0select * into #mytemp from authorsset rowcount 1selec 阅读全文
posted @ 2010-01-18 10:26 iwteih 阅读(511) 评论(0) 推荐(0)
 
MSMQ的简单包装类
摘要: 最近小小地研究了一下MSMQ,如果把MSMQ用的灵活自如,炉火纯青那要花大功夫了,而且不能简单的用.net提供的MessageQueue类了,这个类提供的功能太少。下面的包装类只提供了插入新数据到MSMQ和从MSMQ取数据,还有一个小特色,可以限制Queue里数据数目,如果达到指定数量,就sleep一段时间。首先,加入引用System.Messaging.dll, 以及Interop所使用的com... 阅读全文
posted @ 2010-01-18 10:18 iwteih 阅读(686) 评论(0) 推荐(1)
 
IDENT_CURRENT ,@@IDENTITY, SCOPE_IDENTITY
摘要: IDENT_CURRENT returns the last identity value generated for a specific table in any session and any scope. @@IDENTITY returns the last identity value generated for any table in the current session, ac... 阅读全文
posted @ 2010-01-18 10:15 iwteih 阅读(241) 评论(0) 推荐(0)
 
8位一组压缩字符串
摘要: 若字符串都是由asiic码中的字符组成,我们可以把一个字符转成8位来表示,比如a的ascii码是97,对应的二进制是0110,0001,所以我们可以用一个int(32位)来表示4个字符(char),或者64位的int表示8个char。在C#中一个char是16位Unicode 字符,这样,可以省一半的空间。当然这只是个trick,或者当个练笔也不错。下面是代码实现: 阅读全文
posted @ 2010-01-18 10:13 iwteih 阅读(590) 评论(0) 推荐(0)
 
上一页 1 ··· 4 5 6 7 8 9 下一页