title: encrypted connection string in web.config
body: <p>How can an encrypted connection string be read in the C# code when the encrypted connection string is kept in an external configuration file and specified by configSource attribute in the connectionStrings section of web.config of an asp.net application? </p>
  
  <p>The external config file should only have connectionStrings node, but when it is encrypted, the configDataProvider node should also be present in the same file. And so it cannot be used in the configSource attribute. </p>
  
  <p>I have encrypted connection strings and want to have it in external config file. How can this be handled? </p>
  
  <p>Thanks for any pointers.</p>