c# namespaces for SQL management, used for sql server backup
I am trying to pragmatically run a backup of an SQL Server database using C# .NET 3.5/4.0. I have found out how to accomplish this, however I can't seem to find the namespace libraries that 开发者_运维百科are used for the backup.
I am looking for the Microsoft.SqlServer.Management libraries, I just can't find these anywhere. I have installed SQL Server 2005 Enterprise and all of the tools samples and the libraries still don't seem to appear in visual studio (version 2010)
Any input is appreciated, thanks.
You will find them under:
"C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies"
(Thats on my 64-bit machine for SQL 2008.)
You need all three of the following assemblies:
- Microsoft.SqlServer.Smo.dll
- Microsoft.SqlServer.SqlEnum.dll
- Microsoft.SqlServer.SmoEnum.dll
http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo(v=SQL.90).aspx
The Assemblies for SMO and the like exist under C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies
(adjust for appropriate bitness of your machine and SQL Server version - I think 2005 would be \90\
rather than \100\
精彩评论