NHibernate 2.1的SQL.Data.SqlLite版本 [英] SQL.Data.SqlLite version with NHibernate 2.1

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

问题描述

NHLibernate可以使用SQLLite的哪个版本/实现.我收到错误消息:

What version/implementation of the SQLLite can be used with NHibernate. I get an error:

IDbCommand和IDbConnection 组装中的实施 找不到SQLite.NET.确保 程序集SQLite.NET是 位于应用程序目录中 或在全局程序集缓存中.如果 组件在GAC中,使用 中的元素 应用程序配置文件到 指定程序集的全名.

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.

Let me say that dll is in the bin directory, I made sure. I am using System.Data.SQLite.DLL version 1.0.60.0.

这是hibernate.cfg.xml

Here is the 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机器上运行它.

I am running this on Window XP box.

推荐答案

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

IDbCommand and IDbConnection are in the System.Data namespace, not in SQLite. Would you post your nhibernate configuration settings?

以下是相关设置

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

SQLite20Driver用于System.Data.SQLite,而SQLiteDriver用于SQLite.NET.因此,SQLite20Driver是您的答案.

SQLite20Driver is for System.Data.SQLite, while SQLiteDriver is for SQLite.NET. So SQLite20Driver is your answer.

这篇关于NHibernate 2.1的SQL.Data.SqlLite版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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