Sql2008.Database task

Sep 5, 2011 at 2: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. 

Coordinator
Sep 5, 2011 at 3:16 PM

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

Sep 6, 2011 at 9: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 ;-)

Coordinator
Sep 6, 2011 at 9:58 AM

Great.

The key is in the Inheritance Hierarchy documented.

Inheritance Hierarchy

System.Object 

Microsoft.Build.Utilities.Task   

MSBuild.ExtensionPack.BaseTask     

MSBuild.ExtensionPack.Sql2008.Database

 

This is especially pertinent when the task supports remote execution.

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

Thanks for the feedback.

Mike

Sep 6, 2011 at 11:43 AM
Edited Sep 6, 2011 at 11:44 AM

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.