c# - Changing Nhibernate Connectionstring -
simple question how change connection string of nhibernate @ runtime ?
<property name="connection.connection_string" >value</property>
nevermind got it.
configuration configuration = configurationmanager.openexeconfiguration(configurationuserlevel.none); var root = xelement.load(configuration.filepath); root.elements().where(m => m.name.localname == "hibernate-configuration").first().elements().first().elements().where(m => m.firstattribute.value == "connection.connection_string").first().value = cs; root.save(configuration.filepath);
Comments
Post a Comment