How easy is it to backup a SQL Server database via C# code?
I see lots of related questions, but no real answers.
If you want to work with the stream of bytes in C#, for instance compressing the stream before writing to disk, you're welcome to look at the code from my project, SQL Server Compressed Backup. It has a small VDI (the SQL Server virtual device API) DLL wrapper written in C++ faithfully exposing each VDI option to .Net, and the rest (the bulk) of the code is written in C#.