Created
January 20, 2017 07:34
-
-
Save wajatimur/98079f07aec3a639931de9994304138b to your computer and use it in GitHub Desktop.
Configuring Config on Runtime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var configuration = WebConfigurationManager.OpenWebConfiguration("~"); | |
var section = (ConnectionStringsSection)configuration.GetSection("connectionStrings"); | |
section.ConnectionStrings["MyConnectionString"].ConnectionString = "Data Source=..."; | |
configuration.Save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment