具有.NET Core 2.1的DB2 [英] DB2 with .NET Core 2.1
问题描述
我在Visual Studio 2017&中安装了IBM.Data.DB2.Core版本(1.2.2.100)。 .Net Core 2.1。我试图测试简单的DB2(z / OS服务器)连接,并得到以下错误。我们的DB2服务器类型为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.
错误[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;
}
}
我也将许可证文件复制到.nuget\软件包\ibm.data.db2.core\1.2.2.100\build\clidriver\license文件夹。
我尝试了这里提到的所有内容:
> 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
Also I copied the license file to .nuget\packages\ibm.data.db2.core\1.2.2.100\build\clidriver\license 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
有什么想法吗?
推荐答案
.net核心版本1.1的IBM DB2 Nuget软件包& 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版本并重新打开它,它将正常工作。
- Install IBM DB2 Nuget package version 1.0
- Update your environment PATH variable with 1.0 installation path
- Remove/Un-install any other DB2 driver installed on your machine
- Close your Visual studio version and reopen it, it will work without any issue.
此外,1.0版不需要许可证文件。希望这可以帮助。
Also, 1.0 version doesn't require the license file. Hope this helps.
这篇关于具有.NET Core 2.1的DB2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!