具有.NET Core 2.1的DB2 [英] DB2 with .NET Core 2.1

查看:286
本文介绍了具有.NET Core 2.1的DB2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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.


  1. 安装IBM DB2 Nuget软件包版本1.0

  2. 使用1.0安装路径更新您的环境PATH变量

  3. 删除/卸载任何其他文件在您的机器上安装的DB2驱动程序

  4. 关闭Visual Studio版本并重新打开它,它将正常工作。

  1. Install IBM DB2 Nuget package version 1.0
  2. Update your environment PATH variable with 1.0 installation path
  3. Remove/Un-install any other DB2 driver installed on your machine
  4. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆