title: Storing CipherValue of ConnectionString
body: <p>I'm having trouble making my connection string a CipherValue. I have read the <a href="https://msdn.microsoft.com/en-us/library/ms254494(v=vs.110).aspx#Anchor_2" rel="nofollow">microsoft library</a> but it kinda hard to follow along. This is what I have so far.</p>
  
  <p><strong>app.config</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;connectionStrings&gt;
      &lt;add name="myDatabase" connectionString="Server={hostname};Initial Catalog={database};User ID={username};Password={password};"/&gt;
    &lt;/connectionStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>And in my designer I have 4 inputs for hostname, database, username and password and 1 remember me check box and a connect button. I would like to make the connectionString="ACipherValue" to secure the database credentials. What I have so far in my connect button click event is:</p>
  
  <pre><code>Dim connString = ConfigurationManager.ConnectionStrings("users").ConnectionString
  
  connString = connString.Replace("{hostname}", txtHostname.Text)
  connString = connString.Replace("{database}", txtDatabase.Text)
  connString = connString.Replace("{username}", txtUsername.Text)
  connString = connString.Replace("{password}", txtPassword.Text)
  
  MsgBox(connString.ToString)
  </code></pre>
  
  <p>The message box show the correct connection string to connect to my database. My problem is I do not know how to update my <strong>app.config</strong> connection string to a CipherValue. Is it possible or I should try another method?</p>