Passing arrays, key value pairs, and other collections to SQL stored procedures using table valued parameters.

Overview MS SQL server doesn’t support arrays or other collection data types, so we can’t directly send in these types as parameters to stored procedures from client applications. But fortunately, SQL does allow us to send in DataTable objects in MS SQL Server 2008 and later. The solution here is to simply convert our collection…

7

Sending messages and commands to a Hyper-V Virtual Machine Guest OS using the KVP Exchange

Part 1: Overview Hyper-V virtual machines regularly need to communicate bits of information back to the Hyper-V hosts. Items like the current IP address, Operating System version, guest integration components version, etc. Sometimes the Hyper-V host also needs to send messages to the VM Guest OS (like issuing a Shutdown command). Hyper-V has built in…

3

Executing PowerShell scripts from C#

In today’s post, I will demonstrate the basics of how to execute PowerShell scripts and code from within a C#/.NET applications. I will walk through how to setup your project prerequisites, populate the pipeline with script code and parameters, perform synchronous and asynchronous execution, capture output, and leverage shared namespaces. Update 8/7/2014: Here is the…

40