public void SystemBackup() { var dbconn = m_appobj.FindDatabaseConnection(); var sconn = dbconn.Connection.SystemConnection; string bakdir = sconn.ExecuteScalar(@" declare @BackupDirectory nvarchar(512); exec master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'BackupDirectory', @BackupDirectory OUTPUT; select @BackupDirectory AS [BackupDirectory]").ToString(); MsSqlBackupDialog.Run(bakdir, dbconn.CloneSource()); }
public static void Run(string bakdir, IDatabaseSource db) { var win = new MsSqlBackupDialog(bakdir, db); win.ShowDialogEx(); }