Reply to 2005: using SMO

Your name:

Reply:


Posted by R.A.M. on 11/24/86 11:53

Hello,
I am learning SQL Server 2005. I would like to write a procedure
making database backup using SMO. According to my book I should write
such code:

using Microsoft.SqlServer.Management.SMO;
public static void MakeBackup()
{
Server server = new Server("localhost");
Backup backup = new Backup();
backup.Action = BackupActionType.Database;
backup.BackupSetName = "Backup copy";
backup.BackupSetDescription = "Backup copy";
backup.Database = "DemoSQLServer";
backup.Devices.AddDevice("C:\\DemoSQLServer.bak",
DeviceType.File);
backup.SqlBackup(server);
}

The code cannot be compiled because of error:
The type or namespace name 'Management' does not exist in the
namespace 'Microsoft.SqlServer'.
Please help to correct the problem - I cannot find proper name of SMO
namespace. Is the code OK?
Thank you very much
/RAM/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация