See my code
Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
ConnectionStringSection section = (ConnectionStringSection)config.GetSection("connectionStrings");
section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
What is the "~" inside the curly brackets?
Go to the complete details ...