Archives

Archives / 2008
  • Cursorless Iteration in SQL

    Knowing when to use cursors and when to avoid them is key to being a successful developer. Here's a very useful snippet to use when you want to use a cursorless iteration over a resultset. In the example I create a temp table of widgets and then enumerate each row to print them out: Continue reading...

  • STORM! ORM Mapper Beta Launch

    I'm happy to announce that SquareWidget in partnership with the good folks at FlishHorse have launched the Strongly-Typed Object Relational Mapper (STORM) Beta. Download it now and take it for a spin. What is STORM? It's an add-in into Visual Studio 2005. What does it do? It's an OR mapper. It's a code generator. And there are no third-party black box assemblies or other wackiness. We've used Subsonic, NHibernate, and many other ORM tools and we came to the conclusion that it's no fun writing and maintaining a bunch of XML scripts. And we also didn't like creating custom templates like in CodeSmith. We're lazy. So we made a tool that's trivial to use. Continue reading...

  • IComparer and Sorting Widgets

    Back in the turn of the last century, the golden days of .NET 1.1, if you wanted to implement a type-safe custom collection your best bet was to derive from CollectionBase in the System.Collections namespace. CollectionBase was more than just an abstract base class. It was also a wrapper around an internal ArrayList. If you wanted to sort strongly-typed objects in the collection you would implement an IComparer class: Continue reading...