• Using .Net 3.x Lambda Expressions to Write More Concise Code

    Lambda Expressions via msdn.com: A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types. All lambda expressions use the lambda operator =>, which is read as “goes to”. The left side of the lambda operator specifies the input parameters (if any) […]


  • SQL Script to Search an Entire Database for a Value

    A few months ago I wrote an ad-hoc SQL script to help with the frustrating task of, “Where is this value coming from in the database?” It can be incredibly useful if you are inheriting a database from another team, or are developing on an open-source database application. The script uses SQLServer 2005 or later to […]


  • CONTROVERSIAL OPINION: The ?? Operator in C# is Not Necessary

    Have you ever seen ?? in c# code? The first time you saw it, was your initial reaction “??”? The ??-operator was added in c# 2.0 and as the documentation says, “The ?? operator returns the left-hand operand if it is not null, or else it returns the right operand.” If you’re like me, you […]


  • Using ASP.Net for Code Generation

    Developers periodically find themselves with the need to have utilities to generate large amounts of templated C# code (a common example would be class files from either a database or text file). There are a number of options for writing code generation utilities, from CodeSmith to manually building up large strings in your C# code; […]


  • An Easier Way to Modify the XHTML Output of ASP.NET Controls

    Why would we want to change the output of ASP.NET server controls? When writing either a custom web control derived from an existing control or a control adapter, it is not uncommon that we need to modify the html output of that is normally generated only slightly, without having to reinvent the entire wheel. In […]