开发者

Need reference code for SMO in C# SQL Server 2008

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# wi开发者_运维知识库ll work too.

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


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.


Here is an example with VB.NET http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.restore.aspx You can use a converter to get C#: http://www.developerfusion.com/tools/convert/csharp-to-vb/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜