title: Connection String for a MS Access file?
body: <p>I added a MS Access file into a project and VS created me a DataSet. I was very happy with that, but now I've a small problem:</p>
  
  <p>I want to have the connection string in the app.config file, to allow customer to edit it. I go to the app.config file and I saw this connection String, "GREAT" I thought.</p>
  
  <p>But it seems that this is not used. I found that the connectionString which is used is contained into the Settings.settings file, which I cannot edit at run-time.</p>
  
  <p>Any idea how to resolve this? I even can specify myself the connection string programmatically if needed, but I didn't find how to specify this.</p>
  
  <p>Thank you very much!</p>
  
  <p>EDIT: Here a some code:</p>
  
  <p>One example of the generated code which seems to refer to the Settings.settings file:</p>
  
  <pre><code>[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
          [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
          private void InitConnection() {
              this._connection = new global::System.Data.OleDb.OleDbConnection();
              this._connection.ConnectionString = global::Infoteam.CliniqueLaSource.DocuShare.Communication.DatabaseAccess.Properties.Settings.Default.ClsConnectionString;
          }
  </code></pre>
  
  <p>What I've in my app.config file:</p>
  
  <pre><code> &lt;connectionStrings&gt;
      &lt;add name="Infoteam.CliniqueLaSource.DocuShare.DatabaseAccess.Properties.Settings.ClsConnectionString"
          connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Workspace\CliniqueLaSource.CLS-DocuShare\Main\Resources\Cls.mdb;Persist Security Info=True"
          providerName="System.Data.OleDb" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>What I've in the Settings.settings file:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Infoteam.CliniqueLaSource.DocuShare.DatabaseAccess.Properties" GeneratedClassName="Settings"&gt;
    &lt;Profiles /&gt;
    &lt;Settings&gt;
      &lt;Setting Name="ClsConnectionString" Type="(Connection string)" Scope="Application"&gt;
        &lt;DesignTimeValue Profile="(Default)"&gt;
          &amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;
          &amp;lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&amp;gt;
          &amp;lt;ConnectionString&amp;gt;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Cls.mdb;Persist Security Info=True&amp;lt;/ConnectionString&amp;gt;
          &amp;lt;ProviderName&amp;gt;System.Data.OleDb&amp;lt;/ProviderName&amp;gt;
          &amp;lt;/SerializableConnectionString&amp;gt;
        &lt;/DesignTimeValue&gt;
        &lt;Value Profile="(Default)"&gt;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Cls.mdb;Persist Security Info=True&lt;/Value&gt;
      &lt;/Setting&gt;
    &lt;/Settings&gt;
  &lt;/SettingsFile&gt;
  </code></pre>
  
  <p>Here is a small example of the usage I'm doing:</p>
  
  <pre><code>    ClsDataSet dataSet = new ClsDataSet();
      DOCDOCUMENTSTableAdapter adapter = new DOCDOCUMENTSTableAdapter();
      adapter.Fill(dataSet.DOCDOCUMENTS);
      return dataSet.DOCDOCUMENTS.ToList();
  </code></pre>