does anyone know how to return a value from a (sql) database into an MSBuild script? I want to get the value into a property so I can pass it to subsequent build tasks.
I am fiddling round with something like the following at the moment, but this is returning -1 to indicate the query has executed successfully, whereas what I want is the actual result of the query. (SqlExecute from the community tasks).
<SqlExecute Command='select count(*) from dbo.trade' ConnectionString='XXXX' > <Output PropertyName='TradeCount' TaskParameter='Result' /> </SqlExecute> <Message Text='$(TradeCount)' />
It’s often easiest to just open up the community tasks in Reflector or check the codebase directly to see how it’s intended to be used.