I want to run teambuild's unit tests (more than once) against different databases, e.g. I want to test my build compiles, then run the same suite of tests against SQLServer, then Oracle etc. databases.
I'm pretty sure I could do something clumsy like build/test against 1st config file then build/test against 2nd config file etc. but I'm looking for something more elegant (preferably without the pointless 2nd recompilation).
You'll want seperate unit tests (these are considered system tests, really - since they are involving a database) for each database type. If the same unit test can fail for 1 DB platform and pass for another, then it is not telling you anything specific enough when you look at the pass/fail status and the history of the test results for that test over time.
Otherwise, consider decoupling or abstracting the db connection in such a way that you can programmatically change it while setting up the test (see [ClassInitialize()] and [TestInitialize()] attributes in the MSTEST unit test framework).
The elegant solution is to not depend on the databases for unit tests; create seperate tests for the databases that check the data returned by the queries and procedures you are calling.
Visual Studio 2010 Premium has the capability of running unit tests to verify data and behaviour of SQL Server 2005 (and later) DBs. I would be suprised if you could not also find a tool to test Oracle Dbs or roll your own system of testing what is returned (something like ndbUnit might help)