简体   繁体   English

{“无法从NHibernate.Driver.DB2Driver创建驱动程序。”}我正在使用C#.net

[英]{“Could not create the driver from NHibernate.Driver.DB2Driver.”} I am using C#.net

We are using Nhibernate to connect to DB2 database. 我们正在使用Nhibernate连接到DB2数据库。 From my C# application. 从我的C#应用程序中。 We are able to connect using Odbc and OleDB driver but we need to connect using IBM DB2 driver ( IBM.Data.DB2.dll ). 我们能够使用Odbc和OleDB驱动程序进行连接,但是我们需要使用IBM DB2驱动程序( IBM.Data.DB2.dll )进行连接。

We are not able to connect using it. 我们无法使用它进行连接。 We are getting below error seems NHibernate is not able to create NHibernate.Driver.DB2Driver. 我们正在得到以下错误,似乎NHibernate无法创建NHibernate.Driver.DB2Driver。

{"Could not create the driver from NHibernate.Driver.DB2Driver ."} {“无法从NHibernate.Driver.DB2Driver创建驱动程序。”}

This is the connection string we are using. 这是我们正在使用的连接字符串。

<property name="dialect">NHibernate.Dialect.DB2Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.DB2Driver</property>
<property name="connection.connection_string">Provider=IBMDADB2;Database=Databasename;Hostname=hostname;Protocol=TCPIP; Port=50000;Uid=username;Pwd=password;</property>

According to the source code, a HibernateException is thrown when the IBM.Data.DB2 assembly cannot be loaded. 根据源代码,当无法加载IBM.Data.DB2程序集时,将引发HibernateException。 Make sure that IBM.Data.DB2 is referenced by your project. 确保您的项目引用了IBM.Data.DB2。 If you don't reference it in your project, the assembly will not be copied to the output directory and NHibernate will not be able to find it. 如果您没有在项目中引用它,则程序集将不会复制到输出目录,并且NHibernate将无法找到它。 (The other option would be to install it in the GAC, but I prefer a project reference so that your application is xcopy deployable.) (另一种选择是将其安装在GAC中,但我更喜欢项目参考,以便您的应用程序可以进行xcopy部署。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法从 NHibernate.Driver.SQLite20Driver 创建驱动程序 - Could not create the driver from NHibernate.Driver.SQLite20Driver HibernateException:无法从NHibernate.Driver.MySqlDataDriver创建驱动程序 - HibernateException: Could not create the driver from NHibernate.Driver.MySqlDataDriver 无法从 NHibernate.Driver.SQLServerDriver 创建驱动程序 - Could not create the driver from NHibernate.Driver.SQLServerDriver 无法从 NHibernate.Driver.OracleDataClientDriver 创建驱动程序 - Could not create the driver from NHibernate.Driver.OracleDataClientDriver 无法从NHibernate.Driver.OracleDataClientDriver创建驱动程序(复制本地设置为true) - Could not create the driver from NHibernate.Driver.OracleDataClientDriver (with copy local set to true) 未保存带有C#.NET核心数据的MongoDB.Driver - MongoDB.Driver with C#.NET Core Data Not Saved 如何在不使用 Builders 的情况下使用 .net(c#) 驱动程序更新 mongo db 中的文档? - How can i update document in mongo db using .net(c#) driver without using Builders? .NET DB2 驱动程序选项 - .NET DB2 driver options 如何使用C#驱动程序从现有索引中创建Mongo索引定义? - How can I create a Mongo index definition from an existing one using the C# driver? 通过ibm db2驱动程序将derby与.net c#连接 - Connecting derby with .net c# through ibm db2 driver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM