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

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

问题描述

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

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.

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

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