Skip to content

Instantly share code, notes, and snippets.

@wajatimur
Created January 20, 2017 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wajatimur/98079f07aec3a639931de9994304138b to your computer and use it in GitHub Desktop.
Save wajatimur/98079f07aec3a639931de9994304138b to your computer and use it in GitHub Desktop.
Configuring Config on Runtime
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