This project is read-only.

Sql2008.Database task

Sep 5, 2011 at 3:41 PM

This task type seem to work OK providing i want to connect to the default instance on the local machine using the windows account that msbuild is running as.  However this is not what i want to do, i cannot find a way to specify the SQL instance and provide a sql username and password for the connection.  Is there a way to do this?  I find it hard to beleive this is not possible it seems barely worth the trouble of writing the code for this task if it is so very limited in its use as to make it unusable in the real world. 

Sep 5, 2011 at 4:16 PM

I'm pretty sure you just specify UserName="yourusername" UserPassword="yourpassword" and MachineName="yourinstance"

Sep 6, 2011 at 10:48 AM

Thanks that does seem to work, can i ask that this be added to the documentation.  According to the help file the Sql2008.Database class does not have UserName, UserPassword and MachineName properties and as intellisense is also gone they are a bit hard to guess ;-)

Sep 6, 2011 at 10:58 AM


The key is in the Inheritance Hierarchy documented.

Inheritance Hierarchy






This is especially pertinent when the task supports remote execution.

I'll look at updating the sample so its clearer.

Thanks for the feedback.


Sep 6, 2011 at 12:43 PM
Edited Sep 6, 2011 at 12:44 PM

OK thanks, I am used to inherited members being documented on the derived type al la MSDN, i did not think to dig further up the tree.