views:

26

answers:

2

I googled but cannot find proper simple code for using backup database full and restore the backup, using defaults by using C#.

I am using C# Visual Studio 2008 and SQL Server 2008 R2 evalution but I guess SQL Server 2005 and C# will work too.

The Microsoft site doesn't have code regarding it, it only show description of Microsoft.SqlServer.Management.Smo Namespace......

+2  A: 

MSDN has a topic Getting Started in SMO that covers a lot of ground - there's also a topic called Programming Specific Tasks which shows how to do certain common tasks in C# with SMO.

And there's a whole series of Getting Started with SMO in SQL Server 2005 which still very much applies to the 2008 and 2008 R2 versions of SQL Server.

Here's another Getting started with SQL Server Management Objects (SMO) article to get you up to speed.

marc_s