Tuesday, 14 April 2009

Architect Forum - May 6th 2009

The forum will be on Security and Identity Lifecycle Management.
More information on the Architects Rule! blog here...

Friday, 10 April 2009

SQL Server 2008 SP1 Released

Microsoft has released their final version of Service Pack 1 for SQL Server 2008, less than a year after the Release of SQL Server 2008.

No new features have been added to SP1, byt there are some improvements on usabiltiy.

SQL Server 2008 SP1 is availalable for download here!

Monday, 23 February 2009

Adding toolbox items crashes VS2008

Problem:

When right-clicking the toolbox in an open Visual Studio 2008 environment, I had some strange behavior when selecting "Choose Items ... ".
In fact there was no behavior at all ... my development environment just crashed!!!

Rather annoying if you try to add some new items don't you think?

Cause:

The problem is caused by the Power Commands 2008 Addons for Visual Studio.

Resolution:

Uninstall the Power Commands 2008 Addons...

Wednesday, 11 February 2009

Continue next step after exception

In some case it is handy to catch the exception and then continue with the next step right after the line that threw the exception.
There are several ways to do this, one is writing a try {} catch{} block around every line of code (which will of course pollute your code).

I found some code bits on the internet, which wrap this in a function.
I created a new Console application to demonstrate this.

First we create a class handling this functionality:

public static class Executer
{
public static void Execute(Action action, string errorMessageToLog)
{
try
{
action();
}
catch
{
Console.WriteLine(errorMessageToLog);
}
}
}


Then we create the code in the Main function of our console application:


static void Main(string[] args)
{
for (int counter = 10; counter > -10; counter--)
{
Executer.Execute(() =>
Console.WriteLine((10 / counter).ToString()), "Error Occured");
}
Console.Read();
}


When we run the code, you will notice that when counter = 0, a division by zero will occur, so this will throw an error. This error is displayed to the console and the next value of counter will be processed.