How easy is it to backup a SQL Server database via C# code?
I see lots of related questions, but no real answers.
Or: Generate your backup script in Management Studio, put it in a stored procedure, run procedure from C# code.
CREATE PROCEDURE sp_backup
AS
BEGIN
BACKUP DATABASE [YourDatabase] TO DISK = N'C:\YourPathAndFile.bak'
WITH NOFORMAT, NOINIT,
NAME = N'Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
END
GO