To Brace or not to Brace in C# ifs and other Constructs
Monday 19 October 2009 @ 8:24 am
  In my last post, I found a use for inverting if statements.  That is, I postulated that it is better to have an explicit else when it’s impossible for that code to be executed.  The argument for just falling through the loop with no else is that why have unnecessary code.  [...]
Comments (11) - Posted in Best Practices, C#  


LINQ To SQL Very Slow Performance Without Compile (CompileQuery)
Wednesday 6 May 2009 @ 10:23 am

In this article, it is shown how important it can be to use the CompileQuery class when using LINQ to SQL. Doing a simple query in LINQ to SQL verses ADO.NET is shown to run 37 times slower without taking advantage of the Compile feature in LINQ to SQL. If you are doing the same query over and over in LINQ to SQL, this is a no brainer. I’m surprised I did not know this myself previously.

Performance of LINQ to SQL compiled verses not and ADO.NET

A Great New Book on Business Intelligence Solutions and Sql Server 2008 by Lynn Langit
Monday 23 February 2009 @ 5:42 pm
  I’m sure many of you know SqlServer and it’s many offerings.  She’s always been a wealth of great information about those products and it’s great to see she’s got a book out about one of her favorite topics, Business Intelligence. So far, I’ve read the first four chapters and have skimmed the [...]

First Experience with Visual Studio 2008 Database Edition, I love it!!!
Saturday 17 January 2009 @ 3:06 pm
As a developer who has spent much of my life doing DBA type work, I really appreciate the simplicity and elegance of what SqlManager to manage my data.  I can continue to do that, then when I’ve made my changes, I can simply connect VS2008 Database Edition to my updated development database and it will [...]

View a Generic List with ASP.NET MVC. Step by Step With Preview 5
Tuesday 9 September 2008 @ 1:35 pm
I’ve just started (within the past 2 days) learning and building a prototype with Scott Guthrie’s posts posts have been helpful, as well as reading a pre-release of Manning’s upcoming book Ben Scheirman and

How to User HttpHandler such as .ashx file with IIS7 Integrated Mode, Webfarm Environment
Saturday 6 September 2008 @ 10:20 am
Recently, we’ve moved our hosting for the IIS7’s web.config file (see below)   <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" … [...]

How to do URL Rewrites with ASP.NET 2.0 3.0 3.5 on IIS6 and IIS7 and What is Wild Card Mapping
Sunday 24 August 2008 @ 10:19 pm

A Step by step tutorial on how to use WildCard Mapping for processing URL requests. It includes how to set it with IIS6 and IIS7. It also discusses the theory behind how it works and talks about a great open source packaged called URLRewriter.Net. Basically, how to resolve http://mydomain.com/Home to http://mydomain.com/HomeSite/Home.aspx which looks so much nicer.



Refactoring With ReSharper, Some Very Nice C# fixes I often use
Thursday 3 July 2008 @ 6:59 am

One of the really nice features I enjoy using in Resharper 4.0 is the refactoring that converts inefficient (and unpleasant to read) syntax into nice efficient code. In this post, I’ll show some refactorings that Resharper (from JetBrains) gives us. There are lots more, but the ones listed below seem to come up the most in my own c# code.


Comments (2) - Posted in Best Practices, C#, Tools  


Creating a Modal Login Window Using the Telerik Modal RadWindow ComponentBuilding the Code Camp Web Site (Article 4)
Sunday 29 June 2008 @ 8:47 am

This article shows how to create a modal windows (not a popup) that displays a login windows (asking for username and password) in the middle of whatever asp.net page you are viewing. It uses the Telerik Modal Radwindow control. At the end of a successful login, the login dialog redirects the web user to some page designated by the author. It requires no Javascript programming by the programmer. Just simple method calls in the asp.net page.



Creating a Theme For Each Year of Code Camp Using Skins in ASP.NETBuilding the New Code Camp Web Site (Part 3)
Sunday 25 May 2008 @ 3:17 pm

In this post, we discuss how to use themes and skins together in an ASP.NET web site. A complete example is shown including the web.config, a master page and the theme.skin file. This is an ongoing series of the trials and tribulations of building a new code camp web site.



Multi Level ASP.NET Menu with CSS Friendly Control AdaptersBuilding the New Code Camp Web Site (Part 2)
Monday 19 May 2008 @ 3:38 pm

This article discusses the CSS Friendly Adapters and how they are integraged with the ASP.NET 2.0 menu control. It shows the default html created by a sample menu control without the Friendly Adapters, as well as showing the html created using the Friendly Adapters.



Best Practices for Configuring ASP.NET ConnectionStrings and AppSettings in Web.Config
Saturday 23 February 2008 @ 2:25 pm

This article shows a good way to manage connection string and appsettings values in your web.config file. It shows how to use include files and talks about how to set defaults so moving to production from testing or development can be less painful



In C#, When to use String verses string
Saturday 29 December 2007 @ 11:12 am

Just a short ramble on when to use string verses use String in C#. Basically they compile to the same IL code



Media Browser Using Silverlight 1.1 Alpha and Leverage Software's REST API
Thursday 13 September 2007 @ 6:24 pm

Searchlight was born from the desire to show the outstanding ability of Silverlight to create a compelling web application using existing infrastructure technology.  The products was developed working with Leverage Software, a San Francisco company dedicated to delivering first class communities for it's customer's, Peter Kellner (the Silverlight technology guy), and Uday Gajendar, the design specialist.  Our efforts can be viewed by going to the LeverageSoftware Labs Link Here.  Simply follow the directions on that web page to run the web application.  In this article, many of the Silverlight features in Searchlight are discussed. 

click here if you have Silverlight Alpha 1.1 Installed


Code Camp Presentation Coming 10/27-28/2008 on Silverlight, Los Altos, California
Wednesday 12 September 2007 @ 10:06 pm
I’ll be presenting a session at the upcoming Code Camp in Silicon Valley’s Foothill College on October 27th-28th. Details can be found at http://www.siliconvalley-codecamp.com/Sessions.aspx?ForceSortBySessionTime=true&id=125.
CodeCamp at FootHill College.  Click Here for Details and Registration

Silicon Valley Code Camp Integrates the DevExpress Cloud Control for Sessions
Tuesday 4 September 2007 @ 12:11 pm
Using the DevExpress CloudControl in the ASP.NET 2.0 Silicon Valley Code Camp’s web site was easy. In this short post, you’ll hear about the details and see some code.

Always Set Stop On Exception While Doing Debugging in Visual Studio 2005 or 2008
Friday 10 August 2007 @ 9:05 am

This article discusses a best practices method for automatically having the debugger stop on unhandled exceptions in visual studio 2005 or 2008