title: Using connectionstring from app.config with FSharp.Data.SqlClient
body: <p>I'm using <a href="http://fsprojects.github.io/FSharp.Data.SqlClient/" rel="noreferrer">FSharp.Data.SqlClient</a> and trying to move my connectionString from a <code>[&lt;Literal&gt;]</code> to the app.config.</p>
  
  <p>My app.config looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;connectionStrings&gt;
      &lt;add name="DefaultConnection" connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Test;Integrated Security=True" providerName="System.Data.SqlClient"/&gt;
    &lt;/connectionStrings&gt;
      &lt;startup&gt;
          &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /&gt;
      &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>And my <code>SqlCommandProvider</code> looks like the below, which should be correct according to <a href="http://fsprojects.github.io/FSharp.Data.SqlClient/configuration%20and%20input.html" rel="noreferrer">http://fsprojects.github.io/FSharp.Data.SqlClient/configuration%20and%20input.html</a></p>
  
  <pre><code>new SqlCommandProvider&lt;"SELECT ...", 
         ConnectionStringOrName = "name=DefaultConnection", 
         SingleRow = true, 
         AllParametersOptional = true&gt;(??????)
  </code></pre>
  
  <p>Now the question is. What goes in the last part, the <code>??????</code> part.</p>
  
  <p>I tried <code>"name=DefaultConnection"</code> but it gives me a runtime error with name being unsupported.</p>
  
  <p>I can't seem to find any documentation explaining what goes there.</p>
  
  <h2>Update</h2>
  
  <p>Instaed of fixnig the issue I found this workaround.
  <a href="https://fsprojects.github.io/FSharp.Configuration/" rel="noreferrer">https://fsprojects.github.io/FSharp.Configuration/</a></p>
  
  <p>I don't get the purpose of <code>ConnectionStringOrName</code> if you have to supply the connection string anyway. Also why do you have to specify it twice. Makes very little sense to me :(</p>