Skip to content

Instantly share code, notes, and snippets.

@randyburden
Created March 23, 2015 17:06
Show Gist options
  • Save randyburden/039b9f82a05ce8f8fa48 to your computer and use it in GitHub Desktop.
Save randyburden/039b9f82a05ce8f8fa48 to your computer and use it in GitHub Desktop.
Enables adding a ConnectionString at runtime
// Enables adding a ConnectionString at runtime
typeof ( ConfigurationElementCollection )
.GetField( "bReadOnly", BindingFlags.Instance | BindingFlags.NonPublic )
.SetValue( ConfigurationManager.ConnectionStrings, false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment