Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Backup from SMO
Message
 
 
To
10/02/2009 23:15:42
General information
Forum:
Microsoft SQL Server
Category:
Backups
Title:
Environment versions
SQL Server:
SQL Server 2005
Application:
Web
Miscellaneous
Thread ID:
01380778
Message ID:
01380779
Views:
33
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform