【发布时间】:2012-02-14 07:33:17
【问题描述】:
我想使用 Firebird 2.5。在 .NET 4.0 项目中嵌入 NHibernate 3.2。使用 firebird 提供者的代码,这项工作非常棒。但是当我尝试配置 NHibernate
Configuration = new Configuration().Configure();
UPD:
当我尝试构建会话工厂时
Factory = Configuration.BuildSessionFactory();
发生错误:
文件“C:\MYDB.FBD”的“CreateFile(打开)”操作期间出现 I/O 错误 尝试打开文件时出错
在 app.config 中一切正常
<configSections>
<section
name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"
/>
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.driver_class">NHibernate.Driver.FirebirdClientDriver</property>
<property name="connection.connection_string">
Server=localhost;
ServerType=1;
Database=C:\MYDB.FBD;
User=SYSDBA;Password=masterkey
</property>
<property name="show_sql">true</property>
<property name="dialect">NHibernate.Dialect.FirebirdDialect</property>
<property name="command_timeout">60</property>
<property name="query.substitutions">true 1, false 0, yes 1, no 0</property>
</session-factory>
</hibernate-configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
【问题讨论】:
-
为什么要为嵌入式数据库指定 LOCALHOST?尝试将此属性留空。
-
@AndreiK。我试过了。但一切都没有改变。目前我正在寻找有关实施 IConnectionProvider 的一些信息
标签: .net nhibernate firebird-embedded