gpt4 book ai didi

nhibernate - SQL.Data.Sqlite 版本与 NHibernate 2.1

转载 作者:行者123 更新时间:2023-12-03 12:04:30 26 4
gpt4 key购买 nike

SQLLite 的哪个版本/实现可以与 NHibernate 一起使用。我收到一个错误:

The IDbCommand and IDbConnection implementation in the assembly SQLite.NET could not be found. Ensure that the assembly SQLite.NET is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use element in the application configuration file to specify the full name of the assembly.



让我说 dll 在 bin 目录中,我确定。
我正在使用 System.Data.SQLite.DLL 版本 1.0.60.0。

这是 hibernate.cfg.xml
    <property name="connection.driver_class">
<!--NHibernate.Driver.SqlClientDriver-->
NHibernate.Driver.SQLiteDriver
</property>
<property name="connection.connection_string">
<!-- Server=.\SQLEXPRESS;User Id=epitka;Password=password;Database=dnn49;-->
Data Source=nhibernate.db;Version=3
</property>
<property name="dialect">NHibernate.Dialect.SQLiteDialect</property>

<property name="query.substitutions">true=1;false=0</property>

<property name="show_sql">true</property>

我在 Window XP 机器上运行它。

最佳答案

IDbCommand 和 IDbConnection 在 System.Data 命名空间中,而不是在 SQLite 中。你会发布你的 nhibernate 配置设置吗?

以下是相关设置

dialect = NHibernate.Dialect.SQLiteDialect, NHibernate
connection.driver_class = NHibernate.Driver.SQLite20Driver, NHibernate

SQLite20Driver 用于 System.Data.SQLite,而 SQLiteDriver 用于 SQLite.NET。所以 SQLite20Driver 就是你的答案。

关于nhibernate - SQL.Data.Sqlite 版本与 NHibernate 2.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1460045/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com