问题
does anybody know how to configure NHibernate properties file to use a connection string already specified in configuration element?
回答1:
I found it on 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>
来源:https://stackoverflow.com/questions/455664/how-to-configure-nhibernate-to-use-connection-string-from-connectionstrings-co