gpt4 book ai didi

c++ - 除了托管代码之外,还有什么方法可以在 C++ 中使用 SMO 吗?

转载 作者:行者123 更新时间:2023-11-28 01:13:18 25 4
gpt4 key购买 nike

除了托管代码,还有什么方法可以在 c++ 中使用 SQLSERVER SMO(sqlserver 管理对象)?

在这方面帮助我...

我真诚地请求不要重复评论,我仍然没有得到明确的答案

最佳答案

正如您所指出的。这个问题有already been asked没有满意的答案。

SMO 是严格管理代码。以前的版本 DMO 可用于非托管代码。如果您需要使用 SMO,则必须使用 C++/CLI 或为 COM 创建包装器。

来自MSDN Documentation on SMO :

The SMO object model supersedes and replaces SQL-DMO. SMO supports SQL Server 2000, SQL Server 2005, and SQL Server 2008. It supports more SQL Server management tasks and contains many new features in SQL Server. SMO is designed to be more efficient and provide more control.

The DMO library is a COM object model, whereas SMO is implemented as a .NET Framework assembly. COM components are libraries that provide re-usable functionality to applications and in unmanaged application programming. The .NET Framework assemblies provide reusable functionality for the .NET Framework to write managed code applications.

During the transition to .NET Framework technology it is possible to have applications written partly in managed code and partly in unmanaged code. The .NET Framework lets you interface with COM components, which requires a Primary Interop Assembly. A runtime wrapper is required for SQL-DMO so that it can be called from a .NET Framework -based application.

关于c++ - 除了托管代码之外,还有什么方法可以在 C++ 中使用 SMO 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/876301/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com