The default configuration of sql-server does not have the "clr enabled" option as true. Without it being true, your result-set will always be empty. First order of business is to enable it. Simplest way to do it would beto run the following script.
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
-- Turn advanced options back off
EXEC sp_configure 'show advanced options' , '0';
go
Having done that, you should be able to get the resultsets in the output window.
If even that does not work, you want to use SqlPipe.so, the code in the sample above translates to :
SqlPipe pipe = SqlContext.Pipe;
using (SqlConnection conn = new SqlConnection("context connection=true"))
{SqlCommand InsertCurrencyCommand = new SqlCommand();
SqlParameter currencyCodeParam = new SqlParameter("@CurrencyCode", SqlDbType.NVarChar);SqlParameter nameParam = new SqlParameter("@Name", SqlDbType.NVarChar);
InsertCurrencyCommand.CommandText =
"INSERT Sales.Currency (CurrencyCode, Name, ModifiedDate)" +
" VALUES(@CurrencyCode, @Name)";
InsertCurrencyCommand.Connection = conn;
conn.Open();
// InsertCurrencyCommand.ExecuteNonQuery();
pipe.ExecuteAndSend(cmd);
conn.Close();
}