Exporting SQL Query Results to a CSV file using SQLCMD and C#

Fallback Image

Today a colleague asked me how to export SQL Query Results to a CSV file. This got me thinking that it would be a nice exercise to do this from a C# application. So to start off, I downloaded the correct AdventureWorks database for my version of SQL from the following