Run SQL Query and Email Results

The program below will run a SQL script, convert the results to an HTML table, and email you with it. Everything is passed in via command...

TurboObject

Sometimes I want to have a dynamic variable that no matter what property I try to access, never throws an exception. ExpandoObject doesn’t do this....

Cast Hacking

Have you ever wanted to cast a base class into a subclass? Consider these two classes: public class Animal { } public class Dog : Animal { } Because of the...

Generate an Enum from a SQL Server Database Table

I have a lookup table in SQL Server and a corresponding enum in my code – two different sources that represent the same thing. The problem I...

Trick for debugging parallel code

Thanks to Microsoft’s TPL (Task Parallel Library) writing parallel applications has become easy. In some cases it’s as easy as swapping a foreach loop...