Ted Zhang

关于Sharepoint及.NET的种种...

2014年2月19日

CTE

摘要: Why use CTE: Improve code readability Breaking up complex queries into smaller blocks Execution Scope: Don’t use “Go” keyword between CTE and the reference query, only the query that followi... 阅读全文

posted @ 2014-02-19 17:40 Ted Zhang 阅读(188) 评论(0) 推荐(0) 编辑

2013年6月15日

Check if row or table content has changed

摘要: By using CHECKSUM and CHECKSUM_AGG function in SQL Server, we could easily notice that if anything has changed or not. -- Check Row:SELECT CHECKSUM(*) FROM TableFooWHERE ID = 1;-- Check Table:SELECT ... 阅读全文

posted @ 2013-06-15 19:41 Ted Zhang 阅读(187) 评论(3) 推荐(1) 编辑

2013年6月11日

Tips: Save some typing when binding values to UI in WPF/Silverlight

摘要: As we all know, In WPF or Silverlight application, if we want to update the value in the UI when the underlying data has changed, the class need to implement the "INotifyPropertyChanged” interface, which contains one delegate "PropertyChangedEventHandler”.So create a new method, and take t 阅读全文

posted @ 2013-06-11 19:08 Ted Zhang 阅读(124) 评论(0) 推荐(0) 编辑

2013年6月4日

Test Driven Development

摘要: Recently, I start realize the benefits of TDD, it really could give me a chance to think about how others people gonna use my API, how should I design it. So normally, Create a falling test case firs... 阅读全文

posted @ 2013-06-04 15:30 Ted Zhang 阅读(149) 评论(0) 推荐(0) 编辑

2013年5月27日

ASP.NET MVC 3 Refresh

摘要: For those action type which derive from ActionResult Name Result ContentResult String literal EmptyResult None File... 阅读全文

posted @ 2013-05-27 19:07 Ted Zhang 阅读(239) 评论(0) 推荐(0) 编辑

2013年4月10日

Parameter sniffing may cause negative impact on performance

摘要: Here is a great article about this topic. http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html Basically, if you’re suffer from parameter sniffing, try to use local var... 阅读全文

posted @ 2013-04-10 16:08 Ted Zhang 阅读(113) 评论(0) 推荐(0) 编辑

2013年3月26日

Avoid to use "IN", "NOT IN" in SQL statement, try to use "LEFT JOIN" instead.

摘要: When ever you write any SQL statements, try to avoid use "IN", "NOT IN" keyword, even "EXISTS", "NOT EXISTS" Most of people think "EXISTS" is better than "IN", becuase it will use index, but the trut... 阅读全文

posted @ 2013-03-26 14:41 Ted Zhang 阅读(229) 评论(0) 推荐(0) 编辑

2013年1月28日

You Think You know How to install SQL Server?

摘要: If you install SQL server by following click next, next, next button, then you probably should read this.1. Make sure each SQL service has their own dedicate account.2. Choose OS Power Options to “Performance” type.3. Add SQL Service account to “Perform Volume Maintenance Tasks” (Before Install SQL 阅读全文

posted @ 2013-01-28 21:58 Ted Zhang 阅读(165) 评论(0) 推荐(0) 编辑

2012年5月16日

How Default Parameter Works When It Comes Overload Method

摘要: As everybody may already know, Default Parameter is a new feature comes from .NET 4, but I would like to show some code snippets to demo how it works in overload method. So let’s start write some cod... 阅读全文

posted @ 2012-05-16 16:49 Ted Zhang 阅读(165) 评论(0) 推荐(1) 编辑

2012年5月13日

C# Rules

摘要: Design Guidelines for Developing Class Libraries No.1 Keep classes size small. Large class trying to do too many things. Figure out responsibly, use delegation and collaborate small classes ... 阅读全文

posted @ 2012-05-13 22:35 Ted Zhang 阅读(437) 评论(0) 推荐(0) 编辑