Reference Microsoft.SqlServer.Smo.dll

前端 未结 11 1327
轮回少年
轮回少年 2020-12-04 11:59

I need to use Server class which is stored in Microsoft.SqlServer.Smo.dll I don\'t see this assembly in usual References dialog. I have found it at C:/Program Files/Microsof

11条回答
  •  隐瞒了意图╮
    2020-12-04 12:38

    C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies is the correct folder location (or C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies on 64-bit systems).

    You need to add references to:

    • Microsoft.SqlServer.ConnectionInfo.dll

    • Microsoft.SqlServer.Smo.dll

    • Microsoft.SqlServer.Management.Sdk.Sfc.dll

    • Microsoft.SqlServer.SqlEnum.dll

    (These are the minimum files that are required to build an SMO application)

    For SQL Server 2016, this location is C:\Program Files (x86)\Microsoft SQL Server\130\SDK\Assemblies (for the 64bit version).

    Ref.: How to: Create a Visual C# SMO Project in Visual Studio .NET

    The SQL Server Management Objects (SMO) are downloadable as part of the relevant SQL Server (20XX) Feature Pack (check the smallprint as I don't believe these are redistributable?)

提交回复
热议问题