110,570
社区成员
发帖
与我相关
我的任务
分享
Configuration cfg = new Configuration().Configure(@"H:\WORK\Item\hibernate.cfg.xml");
return cfg.BuildSessionFactory();//这里会报错,
//Could not load type NHibernate.Driver.SQLiteDriver. Possible cause: no assembly name specified.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite"/>
<add name="SQLite Data Provider" invariant="System.Data.SQLite"
description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="MySessionFactory">
<!-- properties -->
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SQLiteDataDriver</property>
<property name="connection.connection_string">Data Source=H:\WORK\Item\bin\ItemDB.db;Version=3</property>
<property name="show_sql">true</property>
<property name="dialect">NHibernate.Dialect.SQLiteDialect</property>
<property name="use_outer_join">true</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<mapping assembly="SendbbsEntity" />
</session-factory>
</hibernate-configuration>
</configuration>