title: Lightswitch can't connect to the database on local development (VS 2012)
body: <p>I have LightSwitch installed in VS 2012. I have SQL Server 2012 Express with LocalDB installed on my machine.  </p>
  
  <p>I created a new project, add new table, and when I run the project I get the following error:</p>
  
  <blockquote>
    <p>An error occurred while establishing a connection to SQL Server instance '(LocalDB)\v11.0'.<br>
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Error occurred during LocalDB instance startup: SQL Server process failed to start.</p>
  </blockquote>
  
  <p>This is my config in <code>C:\Users\xxx\Documents\Visual Studio 2012\Projects\NightApp\NightApp\NightApp.Server</code></p>
  
  <pre><code>&lt;add name="_IntrinsicData" 
       connectionString="Data Source=|SqlExpressInstanceName|;AttachDbFilename=|ApplicationDatabasePath|;Integrated Security=True;Connect Timeout=30;MultipleActiveResultSets=True" /&gt;
  &lt;add name="2aaf8de2-05e2-49ae-aead-766e8c010988" 
       connectionString="Data Source=(localdb)\Projects;Initial Catalog=NightDB;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False" /&gt;
  </code></pre>
  
  <p>I also went through <a href="https://stackoverflow.com/questions/13314643/how-to-change-the-connectionstrings-of-a-lightswitch-application-in-debug-mode">how to change the connectionstrings of a lightswitch application in debug mode</a> but I could not get it done.   </p>
  
  <p>BTW, the sql server explorer in vs 2012 is able to connect to the localdb.    </p>
  
  <p>Any ideas?</p>