title: C# and SQL Server CE - Data Source Keyword Not Supported
body: <p>I am trying the following solution and not having much luck:
  <a href="https://stackoverflow.com/questions/7174604/how-can-i-update-app-config-connectionstring-datasource-value-in-c#">How can i update app.config connectionstring Datasource value in C#?</a></p>
  
  <p>The code I have is:</p>
  
  <pre><code>Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
  
  // Because it's an EF connection string it's not a normal connection string
  // so we pull it into the EntityConnectionStringBuilder instead
  EntityConnectionStringBuilder efb = new EntityConnectionStringBuilder(
                  config.ConnectionStrings.ConnectionStrings["WindowsFormsApplication1.Properties.Settings.TestDBConnectionString"]
                      .ConnectionString);
  
  // Then we extract the actual underlying provider connection string
  SqlConnectionStringBuilder sqb = new SqlConnectionStringBuilder(efb.ProviderConnectionString);
  
  // Now we can set the datasource
  sqb.DataSource = "|DataDirectory|\\TestDBa.sdf";
  
  // Pop it back into the EntityConnectionStringBuilder 
  efb.ProviderConnectionString = sqb.ConnectionString;
  
  // And update...
  config.ConnectionStrings.ConnectionStrings["WindowsFormsApplication1.Properties.Settings.TestDBConnectionString"]
              .ConnectionString = efb.ConnectionString;
  
  config.Save(ConfigurationSaveMode.Modified, true);
  ConfigurationManager.RefreshSection("connectionStrings");
  </code></pre>
  
  <p>My <code>app.config</code> file has:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;&lt;configuration&gt;
  &lt;configSections&gt;
  &lt;/configSections&gt;
  &lt;connectionStrings&gt;
      &lt;add name="WindowsFormsApplication1.Properties.Settings.TestDBConnectionString"
          connectionString="Data Source=|DataDirectory|\TestDB.sdf"
          providerName="Microsoft.SqlServerCe.Client.4.0" /&gt;
  &lt;/connectionStrings&gt;
  &lt;startup&gt; 
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /&gt;
  &lt;/startup&gt;&lt;/configuration&gt;
  </code></pre>
  
  <p>Where am I going wrong?</p>