G
Gab
Hello !
I'am trying from winform application to backup and restore an SQL Server
2005 Database .
But each time , i try my Backup Methode ,I've got this following exception
Microsoft.SqlServer.Management.Smo.FailedOperationException was unhandled
Message="fail to connect the server « 192.168.7.100\X3 ».
My server is « 192.168.7.100\X3 »
My database Name is " caisseDB "
This is my backup() Methode :
public void BackUpNode()
{
string publicationServer= "192.168.7.100\X3";
string publicationDbName ="caisseDB";
ServerConnection conn = new ServerConnection(publicationServer);
Server server = new Server(conn);
Backup bkup = new Backup();
bkup.Database = publicationDbName;
bkup.Action = BackupActionType.Database;
bkup.BackupSetDescription = "Full backup of TEST";
bkup.BackupSetName = "TEST Backup";
BackupDeviceItem bdi = new BackupDeviceItem("c:\test\appCaisseDB.bak",
DeviceType.File);
bkup.Devices.Add(bdi);
// Full backup
bkup.Incremental = false;
bkup.ExpirationDate = DateTime.Now;
bkup.LogTruncation = BackupTruncateLogType.Truncate;
bkup.SqlBackup(server);
}
Thanks for your help !
Gabriel
I'am trying from winform application to backup and restore an SQL Server
2005 Database .
But each time , i try my Backup Methode ,I've got this following exception
Microsoft.SqlServer.Management.Smo.FailedOperationException was unhandled
Message="fail to connect the server « 192.168.7.100\X3 ».
My server is « 192.168.7.100\X3 »
My database Name is " caisseDB "
This is my backup() Methode :
public void BackUpNode()
{
string publicationServer= "192.168.7.100\X3";
string publicationDbName ="caisseDB";
ServerConnection conn = new ServerConnection(publicationServer);
Server server = new Server(conn);
Backup bkup = new Backup();
bkup.Database = publicationDbName;
bkup.Action = BackupActionType.Database;
bkup.BackupSetDescription = "Full backup of TEST";
bkup.BackupSetName = "TEST Backup";
BackupDeviceItem bdi = new BackupDeviceItem("c:\test\appCaisseDB.bak",
DeviceType.File);
bkup.Devices.Add(bdi);
// Full backup
bkup.Incremental = false;
bkup.ExpirationDate = DateTime.Now;
bkup.LogTruncation = BackupTruncateLogType.Truncate;
bkup.SqlBackup(server);
}
Thanks for your help !
Gabriel