带有 .NET Core 2.1 的 DB2 [英] DB2 with .NET Core 2.1
问题描述
我使用 Visual Studio 2017 & 安装了 IBM.Data.DB2.Core 版本 (1.2.2.100).Net 核心 2.1.我试图测试简单的 DB2(z/OS 服务器)连接并收到以下错误.我们的 DB2 Server 类型是 OS390,版本是 11.
I installed IBM.Data.DB2.Core Version (1.2.2.100) with Visual Studio 2017 & .Net Core 2.1. I was trying to test simple DB2 (z/OS server) connection and getting the below error. Our DB2 Server type is OS390 and version is 11.
ERROR [42968] [IBM] SQL1598N 由于许可问题,尝试连接到数据库服务器失败.
ERROR [42968] [IBM] SQL1598N An attempt to connect to the database server failed because of a licensing problem.
using (DB2Connection con = new DB2Connection("Server=xxxx.xxxx.com:446;Database=XXXX;UID=XXXXXX;PWD=xxxxx"))
{
try
{
con.Open();
}
catch (Exception ex)
{
throw ex;
}
}
我也将许可证文件复制到 .nugetpackagesibm.data.db2.core1.2.2.100uildclidriverlicense 文件夹.我尝试了这里提到的所有内容:
Also I copied the license file to .nugetpackagesibm.data.db2.core1.2.2.100uildclidriverlicense folder. I tried everything mentioned here: https://www.ibm.com/developerworks/community/blogs/96960515-2ea1-4391-8170-b0515d08e4da/entry/Instructions_for_downloading_and_using_DB2_NET_Core_provider_package?lang=en
有什么想法吗?
推荐答案
IBM DB2 Nuget package for .net core version 1.1 &1.2 自带 DB2 驱动程序版本 11.如果您的 DB2 版本低于 11,则这两个包不支持.以下是解决此问题的步骤.
IBM DB2 Nuget package for .net core version 1.1 & 1.2 comes with DB2 Driver version 11. These two packages doesn't support if you have DB2 version less than 11. Here are the steps to resolve this issue.
- 安装 IBM DB2 Nuget 包 1.0 版
- 使用 1.0 安装路径更新您的环境 PATH 变量
- 删除/卸载您机器上安装的任何其他 DB2 驱动程序
- 关闭您的 Visual Studio 版本并重新打开它,它将正常运行.
此外,1.0 版本不需要许可证文件.希望这可以帮助.
Also, 1.0 version doesn't require the license file. Hope this helps.
这篇关于带有 .NET Core 2.1 的 DB2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!