title: Keyword not supported: 'data source'.: EF code-first using ObjectContext and LocalDB
body: <p>I am getting a "keyword not supported error" when I try to connect to a LocalDB database using ObjectContext.</p>
  
  <p>This is my connection string:</p>
  
  <pre><code>&lt;add name="connStr" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=proj1db;Integrated Security=True" /&gt;
  </code></pre>
  
  <p>and this is the code that tries to create an instance of the ObjectContext:</p>
  
  <pre><code>var connectionString = ConfigurationManager
                  .ConnectionStrings["connStr"]
                  .ConnectionString;
  ObjectContext _context = new ObjectContext(connectionString);
  </code></pre>
  
  <p>The last line throws System.ArgumentException: Keyword not supported: 'data source'.</p>
  
  <p>I am using Visual Studio 2012 for Web and targeting .NET Framework 4.5. I have LocalDB installed on my machine.</p>
  
  <p>If I use DbContext instead it works:</p>
  
  <pre><code>public class proj1dbContext: DbContext
  {
      public proj1dbContext() : base("name=connStr")
      ...
  </code></pre>
  
  <p>It seems that this is a similar question
  <a href="https://stackoverflow.com/questions/6916785/help-with-ef-code-first-connection-string">Help with EF Code first connection string</a>
  but unfortunately it does not give a definitive answer to why instantiating ObjectContext throws that error.</p>
  
  <p>Any help is appreaciated. Thanks!</p>