C Sharp Method Group Conversions

// The following is a simple example of event handlers without having to declare new’s 

using System;

namespace DelegateConsole
    public class SimpleMaths
        public delegate void MathsMessage(string msg);
        public event MathsMessage ComputationFinished;

        public int Add(int x, int y)
            ComputationFinished(“Adding Complete”);
            return x + y;
        public int Subtract(int x, int y)
            ComputationFinished(“Subtracting Complete”);
            return x – y;       

    class Program
        static void Main(string[] args)
            SimpleMaths s = new SimpleMaths();
            // Method group conversion – almost a delphi event handler
            s.ComputationFinished += ComputationFinishedHandler;
            Console.WriteLine(“10 + 10 is {0}”,s.Add(10,10));

        static void ComputationFinishedHandler(string msg)

SQL Server performance problem

This is a link to a SQL Server sp4 problem and a suggested soltion.

SQL Server sp3 had a bug in which indexes with non-integer numeric values could miss values in a select – especially when comparing differing precision.

The solution that they implemented can result in table scans – causing a huge performance penalty in areas that were unaffected by the problem. I known that missing data is bad – but forcing table scans is a rather severe penalty.

Investigation of CSLA 2

I am investigating the use of CSLA 2.

How complex is this to use out of the box and can it be combined with the Castle Project?

So far I have downloaded the source from. The source supplied builds as is.

I only have the CSLA 1 book and am trying to see if I can get CSLA 2 to work using just that.

First step is to use VS.NET to create a database and add some tables.

VS 2005 Rant 

The VS.NET IDE allows the creation of a database and adding tables.

It will refuse to rename rows and can only change datatypes according to the underlying db rules (why can’t it remove and reinsert a column?)

 I am now entering the stored procedures for the Product Tracker application.

They seem to be very simplistic with no error handling or auditing (but this is a demo application).

The joins are not very explict sometimes being of the form SELECT A, B FROM FOO, BAR WHERE …

I can see why Kathleen Dollard decided to use this as a basis for her code generation tools.

These are intrisically generatable stored procedures – compare to those that I have been used to with integrated error handling anf auditing. 

MS finally get TDD

Microsoft have finally learnt about TDD.

A year or so ago they had an article trying to claim a process of TDD that invloved generating the tests from the code.

They rapidly pulled the article as it clearly showed that they did not get the idea at all. 

The problem with their suggestion is that it involves Visual Studio Team System which is a bit of a sledgehammer compared to say NUnit and CruiseControl.NET which are far more mature products.