Solved

Backup SQL Database using SMO - Can't find Backup

Posted on 2012-12-30
3
571 Views
Last Modified: 2013-01-02
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
0
Comment
Question by:elmbrook
3 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 38732112
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
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 38734062
0
 

Author Closing Comment

by:elmbrook
ID: 38737749
The articles I found did not relate to this .dll file at all.
Thanks for the help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now