title: Create ConnectionString on fly for SQLite and Entity Framework
body: <p>I am owndering about a way to create a <code>ConnectionString</code> on fly for <code>SQLite</code> and <code>Entity Framework</code> (MS VS2015, MS .NET Framework 4.5.6).</p>
  
  <p>I mean the application gets some databases connectionstring and choose one of them.</p>
  
  <p>Basically I would like to do it here </p>
  
  <pre><code>MyAppEntities context = new MyAppEntities();
  </code></pre>
  
  <p>The class itself looks like</p>
  
  <pre><code>public partial class MyAppEntities : DbContext
      {
          public MyAppEntities ()
              : base("name=MyAppEntities")
          {
          }
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              throw new UnintentionalCodeFirstException();
          }
  
          public virtual DbSet&lt;Commands&gt; Commands { get; set; }
          public virtual DbSet&lt;Errors&gt; Errors { get; set; }
  
      }
  </code></pre>
  
  <p>Also I would like to know if possible to use relative path for SQLite here</p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;add name="MyAppEntities " connectionString="metadata=res://*/DatabaseModel.AgentDataModel.csdl|res://*/DatabaseModel.AgentDataModel.ssdl|res://*/DatabaseModel.AgentDataModel.msl;provider=System.Data.SQLite.EF6;provider connection string=&amp;quot;data source=D:\Databases\MyAgent.db&amp;quot;"
        providerName="System.Data.EntityClient" /&gt;
      &lt;add name="MyAppAgent.Properties.Settings.MyAppAgentConnectionString"
        connectionString="data source=D:\Databases\MyAgent.db"
        providerName="System.Data.SQLite.EF6" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Any clue how it can be done?</p>