有谁知道如何配置NHibernate属性文件以使用已在配置元素中指定的连接字符串?
答案 0 :(得分:24)
我在google.com上找到了它:
<connectionStrings>
<add name="connection_string_name" connectionString="[connection string]"/>
</connectionStrings>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
...
<property name="connection.connection_string_name">connection_string_name</property>
...
</session-factory>
</hibernate-configuration>