无法连接到 DB2:Azure 函数上的 IBM.Data.DB2.Core 版本 3.1.0.400 [英] Cannot connect to DB2: IBM.Data.DB2.Core version 3.1.0.400 on Azure Function
本文介绍了无法连接到 DB2:Azure 函数上的 IBM.Data.DB2.Core 版本 3.1.0.400的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 nuget 包 IBM.Data.DB2.Core 版本 3.1.0.400 从带有 Azure Functions 版本 v3 (Windows) 的 Azure 函数连接到 IBM DB2 数据库.应用程序构建成功.
在本地执行它时,我面临以下异常.
IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [] [IBM][CLI Driver] SQL10007N 消息0"无法检索.原因代码:6".在 IBM.Data.DB2.Core.ConnSettingsFromXmlConfig.ProcessFromXmlConfig(DB2Connection 连接、字符串 dbname、字符串主机、字符串端口、字符串 tmpClientEncAlg、字符串 tmpAuthentication、字符串 prevdb、字符串 prevdb_ori、DB2ConnSettings& sSettings、DB2ConnSettingsInternal& sSettingsInternal、StringBuilder& modifiedValue)在 IBM.Data.DB2.Core.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection 连接,字符串 szValue,DB2ConnSettings 和 pSettings,DB2ConnSettingsInternal 和 pSettingsInternal,布尔 bAttach,布尔 pushDownStrAppended)在 IBM.Data.DB2.Core.DB2Connection.set_ConnectionString(字符串值)在 IBM.Data.DB2.Core.DB2Connection..ctor(字符串 connectionString)
这是代码片段,在实例化 DB2Connection 时,我遇到了异常.
使用 (var db2Connection = new DB2Connection(_configuration["DB2_ConnectionString"])){db2Connection.SystemNaming = true;
请注意.此代码在我能够连接到 DB2 的控制台应用程序中运行良好.
谢谢大家.
解决方案
Azure 函数支持目前在 Db2 .NET 中不可用提供者.它将在即将发布的 .NET 5 和.NET Core 3.1.
查看全文