August 2006 Blog Posts
Visio: Why won't my line formatting apply to a relationship line?

You have to turn off the line style for a relationship arrow before it will pick up your formatting.

posted @ Thursday, August 31, 2006 4:19 PM | Feedback (0)
SQL: Using a CSV with an IN sub-select

Handy function to have around:

posted @ Thursday, August 31, 2006 10:32 AM | Feedback (0)
The kingdom of Nouns

An attack against OOP (or how Java and C# do it anyway).  Regardless of whether I agree with all of it, the nursery rhyme is worth the read itself:

posted @ Friday, August 25, 2006 10:33 AM | Feedback (0)
Conditional code for Creating Unit Tests for both VSTS and Nunit

This allows you to create a single class that can be compiled in different projects to use unit tests in either VSTS or Nunit.  From Microsoft's Enterprise Library January 2006:

Where NUNIT is a defined constant in your project file.
#if !NUNIT
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
posted @ Friday, August 25, 2006 10:31 AM | Feedback (0)
Continuous Integration using Visual Studio Team Foundation Server

There is code and an article for setting up Team Foundation Server for Continuous Integration that can be found at MSDN here:

Unfortunately, the article was not clearly written, with incorrect syntax for an important command.

Install the software as normal, making sure you create the virtual directory underneath the root of the application server for Team Foundation Server (this should be an IIS website called “Team Foundation Server” on port 8080.  If you did something funky, put it in the funky place).

The subscription you need to create, however, does NOT follow the syntax of the article.  It should be thus:

BisSubscribe.exe /eventtype CheckinEvent /address http://myMachine:8080/CI/notify.asmx /deliveryType Soap /server myMachine

where “myMachine” is the name of your server where you installed VSTS, and assuming you installed the CI software in the default virtual directory.

You also need to go into the web.config file underneath the /CI virtual directory (or where ever you installed it) and create the appsettings like this:

<add key="1" value="TeamServer=http://myMachine:8080;TeamProjectName=ProjectName;BuildType=BuildTypeName“/>

And make sure to create the entries outside of the commented code (which I did not do at first, simply changing the example setting, which is inside commented code and so useless).

The other thing is to remember to go into Visual Studio and when in Team Explorer and highlighting the Team Project you are working on to use the Team menu that appears to create and send emails on build events (I used VSTS for almost 6 months before knowing this option existed) so you know your builds are working.

posted @ Monday, August 14, 2006 12:40 AM | Feedback (0)
T-SQL: Query using max in a self-reference

Since I always forget how to do this:

delete [table name]
from [table name] as t1
inner join
select column1, max(column2) as datadate from [table name]
group by column1
) as t2 on
t1.column1 = t2.column1
where t1.datadate <= dateadd(yy, -1, t2.datadate)
posted @ Thursday, August 10, 2006 12:15 PM | Feedback (0)
ASP.NET: Could not load type

Various solutions to this problem can be found here:

For me, deleting dlls usually works (you might also need to go into the temporary files directory inside the Microsoft.Net framework directory and delete all files there as well...this may require restarting or even rebooting the server).

posted @ Wednesday, August 09, 2006 2:01 PM | Feedback (0)
T-SQL: finding a table

If you know the server and the table name, but not which database it is in, run this:


Oddly, you need to run it in Query Analyzer, not SQL Management Studio as the latter will start to execute it, but will through an error before it completes (at least in my situation it does...could be the number of databases).

sp_MSForEachDB "SELECT name AS '?' FROM [?]..sysobjects where name = 'TableName'"
posted @ Friday, August 04, 2006 1:42 PM | Feedback (0)
Duplicate 'ComVisible' Attribute

This will happen within Visual Studio with Web Application Projects (the new project type from Microsoft..... ) if you have nested web sites (e.g. you have a top-level site that has one or more child sites).  What happens is the project for the top-level site sees multiple assemblyinfo.cs files (its own and the child sites') when it tries to build, and so fails.

Simply set the build action for the child sites' assemblyinfo.cs files to “None” (within properties), and all will be fine.  This is a project level setting, so the project for the child site will compile the asssemblyinfo.cs file normally.

posted @ Thursday, August 03, 2006 7:05 PM | Feedback (0)