1 2 3 4 5 6 7 8 9 10 11
| private sub button_click
try
dim cn =new sqlclient.sqlconnexion("data source=./sqlexpress;initial catalog=dbname;integrated security=true")
cn.open
dim backup as string="BACKUP DATABASE [model] TO DISK = N'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\model.bak' WITH NOFORMAT, NOINIT, NAME = N'model-Complète Base de données Sauvegarde', SKIP, NOREWIND, NOUNLOAD, STATS = 10"
dim cmd=new sqlclient.sqlcommand(backup,cn)
cmd.executednonquery()
cn.close
catch ex as exception
msgbox(ex.Message)
end try |
Partager