you can and very possibly do what you asked,
but doing backup yourself using SMO is not very difficult, but the hard part is managing the backup and recovery.
it would be difficult to put all the code here, but it won't work. so I will try to do everything you need.
SqlBackup.SqlBackup does not return any value; its function is void. but one server parameter is required, try the following code:
Server srvSql; //Connect to Server using your authentication method and load the databases in srvSql // THEN Backup bkpDatabase = new Backup(); bkpDatabase.Action = BackupActionType.Database; bkpDatabase.Incremental = true; // will take an incemental backup bkpDatabase.Incremental = false; // will take a Full backup bkpDatabase.Database = "your DB name"; BackupDeviceItem bDevice = new BackupDeviceItem("Backup.bak", DeviceType.File); bkpDatabase.Devices.Add(bDevice ); bkpDatabase.PercentCompleteNotification = 1;// this for progress bkpDatabase.SqlBackup(srvSql); bkpDatabase.Devices.Clear();
source share