Loren Halvorson's Blog

If your only tool is a hammer...

  • Free T-SQL Formatter

    If you are working on a project that has a lot of SQL code and wish you could reformat it to make it more readable, I just stumbled on a slick utility that is being developed in C# by Tao Klerks named Poor Man’s T-SQL Formatter.  It can be found here:  http://www.architectshack.com/PoorMansTSqlFormatter.ashx  It’s not finished yet, but has enough functionality to be truly useful.  Tao tells me he is working on refactoring the code to make it more maintainable and adding more formatting options.


  • Upgrading RDLC reports to Report Viewer 2010 in an ASP.NET web application

    One of the web applications I am working on is an ASP.NET MVC 2 site targeting .NET 3.5 SP1 that uses the Microsoft Report Viewer control with local-mode RDLC reports. I initially developed this application using Visual Studio 2008. The client was OK if I started to use Visual Studio 2010, as long as I didn’t require .NET 4.0 just yet. The multi-targeting features of VS2010 were working great. I had started really enjoying VS 2010 and had no intention to go back to 2008. Then I needed to do some report work so I double clicked one of my RDLC files and was surprised to see this message box:


  • Comparing XML Files with Beyond Compare 3...Brilliant

    I bought a new laptop and was loading it with the tools I use every day. When it came to installing one of my favorites, Beyond Compare 2, I thought I'd check the Scooter web site to see if I had the latest version. I was happy to see they now had a version 3 with plenty of new features. I immediately reached for my credit card to buy a license. Folks, this is honestly one of the tools I don't even hesitate paying for...it's that good, and that invaluable. I don't work for them, I'm just a very happy customer.

    The base tool itself is great, but I was really thrilled when I followed the link on the Download page to Additional file format downloads for version 3.  There I found something I've been looking for years...and in fact a while ago had written a plug-in for BC2 to do...the ability to compare Tidied XML.

    How many times have you tried to compare two dense XML files to find out their differences only to be faced with a block of differences that looks like this:

    Beyond Compare notices that there are differences in there somewhere, but can't really show you where with any precision. Further inspection is going to be needed, and forget merging selected changes over from one side to the other.

    If you install the XML Tidied and XML tidied with attributes sorted file formats, you can now tell Beyond Compare to tidy up your documents, putting each attribute on its own line, so the differences stand out. You can now see exactly which attributes differ. Absolutely brilliant.

    This is a fantastic feature that's already saved me a bunch of time. I see there is a similar add-in for HTML tidied files that also will come in handy.

    A couple of other features in Beyond Compare that I've come to rely on over the years:

    • Beyond Compare has great "low-friction" integration with Windows Explorer. For example to compare two files, you just right click on one file and choose "Select Left Side For Compare", then right click on the other file and say "Compare to {file...}".  This works for folders too.
    • Beyond Compare has great FTP integration. I use it to deploy changed files to FTP sites very painlessly.

    I also see it supports doing 3-way merging from most version control systems. I haven't tried this yet, but I'm going to see how hard it is to plug into TFS.  If anyone has pointers on how to set this up, let me know.

     Update: Scooter's website shows how to set it up here

    They have a 30 day trial, so if you aren't so sure, you can give it a try for a while. Highly recommended.


  • New Release of XmlPreprocess

    I finally got around to updating the XmlPreprocess tool with some changes I'm really excited about. For those of you not familiar with XmlPreprocess, it's a command line tool I wrote many years ago that can modify specially annotated XML files much like a code preprocessor. It is useful for deploying XML configuration files to many environments. I've blogged about it in the past as have others, and it's achieved a fair amount of use (albeit hidden below the surface) in my good friend Scott Colestock's Biztalk deployment framework.


  • Introducing Birch Cove Software

    A few days into a 3 week vacation with my family I received a call that I wasn't surprised to receive. The company where I had worked for 6 years was downsizing and my position, along with many others in our department, was eliminated. Since downsizing (or worse) was happening across the entire sector, I didn't take it personally. In fact, I took it as a sign that I should try something different. A friend recently said that "getting laid off is one of the best thing that ever happened to him", and I hope to look back and say the same some day.


  • Red Gate will take over development of Lutz Roeder's .NET Reflector

    I just received a newsletter from Red Gate, and nestled in the headlines was this interesting tidbit. If you haven't heard of .NET Reflector, it's one of my favorites, and I encourage you to check this invaluable tool out. It's what you reach for when you have to know what's going on inside that assembly but don't have the source.