Backup SQL Database using SMO - Can't find Backup

elmbrook
elmbrook used Ask the Experts™
on
ok, I am having some problems with SMO.

1. I have followed the instructions here to add the references (connectionInfo, Management.Sdk.Sfc, Smo, SqlEnum)  

2. I have added to my form the following
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Common;

My code is as follows

Server srv = new Server("servername\\databasename");

Backup bkpDBFull = new Backup(); //Namespace name 'Backup' could not be found error. 

Open in new window


The error is : The type or namespace name 'Backup' could not be found (are you missing a using directive or an assembly reference?)      

Why is it not locating Backup? I am using VS2010 and SQL Server 2008 R2

I was following this code
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Engineer
Commented:
Add a reference from the same folder as the others: SmoExtended.dll

Info found on: http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.backup.aspx
Alpesh PatelSolution Architect at TCS (SAFe®Agilist, TOGAF® Foundation, PSM I®, MCP, MCSD)

Commented:

Author

Commented:
The articles I found did not relate to this .dll file at all.
Thanks for the help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial