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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -