Ben Griswold on June 9th, 2008

Over the weekend, I found myself doing a lot of grunt work creating more than my fair share of data transfer objects which, for me, are nothing more than custom collections which contain very simple objects exposing public properties.  Simple, but cumbersome enough that I wanted to generate the classes. I have been working with [...]

Continue reading about Custom Templates with SubSonic

Ben Griswold on June 9th, 2008

There’s a lot of information (including sample routines) on how to serialize/deserialize objects in C#.  Hunt down a couple of routines that accept generic types and add them to your personal utility class and reuse them forever.  Be aware, however, that there’s an issue with serializing nullable types. Basically it can’t be done if an [...]

Continue reading about C# Serializing Nullable Types

Ben Griswold on June 9th, 2008

My favorite TSQL Function is COALESCE which returns the first non-null expression among its arguments.  If all arguments are null, null is returned.  Here are a couple of simple examples: declare @a varchar(25); set @a = null; declare @b varchar(25); set @b = null; declare @c varchar(25); set @c = ‘I am not null’; select [...]

Continue reading about C# Coalesce Operator

Ben Griswold on June 8th, 2008

I started using the TextMate Theme for Visual Studio a week ago.  This afternoon I switched back to the default VS theme and nearly threw up. It’s really flipping plain to the point of being ugly. All the same, I looked at the white screen for less than a minute and I reinstalled TextMate.  I [...]

Continue reading about It’s Time to Change Your Visual Studio Theme

Ben Griswold on June 8th, 2008

You are familiar with System.IO.Path.Combine() method which combines two path strings and manages the trailing separator character (a.k.a. a backslash (“\”)), right?  Here’s an example of what I am talking about: System.IO.Path.Combine(“C:\temp”, “subdir\file.txt”);// output = “c:\temp\subdir\file.txt” Are you bored yet?   Okay, pop quiz. In my current project, I need to download a file and [...]

Continue reading about Path.Combine() for URLs

Ben Griswold on June 2nd, 2008

I very recently posted about using SubSonic to generate my DAL and SSMS Tool Pack to generate the complementing stored procedures.  In response to the post, Jon Galloway asked a great question in the comments: Thanks for the pointer to SSMS Tool Packs. It looks really interesting. One thing I’m having trouble picturing is the [...]

Continue reading about Code Generation with Stored Procedures?