Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Backup from SMO
Message
 
 
À
10/02/2009 23:15:42
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Copies de sauvegarde
Titre:
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Web
Divers
Thread ID:
01380778
Message ID:
01380779
Vues:
32
>Many thanks to those who helped me tonight on using SMO to backup a database. This is as simple as it gets:
>
>
>        Dim loBackup As Backup = New Backup
>        Dim loServer As Server = New Server
>
>        loBackup.Devices.AddDevice("D:\Data\Backup\MyDatabase.bak", DeviceType.File)
>        loBackup.Database = "MyDatabase"
>        loBackup.Action = Microsoft.SqlServer.Management.Smo.BackupActionType.Database
>        loBackup.Initialize = True
>        loBackup.PercentCompleteNotification = 1
>        AddHandler loBackup.PercentComplete, AddressOf ProgressEventHandler
>        loBackup.SqlBackup(loServer)
>
>    Private Sub ProgressEventHandler(ByVal sender As Object, ByVal e As PercentCompleteEventArgs)
>        UrlDisplay.Text = e.Percent.ToString + "% backed up"
>        Application.DoEvents()
>    End Sub
>
You're welcome.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform