title: How to Connect LocalDb to AppData Folder in ASP.NET MVC 5
body: <p>I have SQL Server Express 2014 installed and I have created a table "MyStructures" that I would like to use with an ASP.NET MVC5 application. I can connect and view the database using "Server Explorer" in Visual Studio. Also I checked that the server is allowed to accept remote connections. Although I don't see why that would matter here because Visual Studio and the database are on the same machine and I am using Windows Authentication. </p>
  
  <p>When I right click on "App_Data" folder and add "New Database" I am getting an error that the is a problem connecting to the database. I am naming the new database file "MyStructures.mdf". How do I connect my web application to the local database? How can I add it to the "App_Data" folder?</p>
  
  <p>In my Web.config file I have the following code...is this correct?</p>
  
  <pre><code> &lt;connectionStrings&gt;
  &lt;add name="DefaultConnection" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\MyStructures.mdf;Integrated Security=True"
    providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p></p>
  
  <p><img src="https://i.stack.imgur.com/mAWt7.png" alt="enter image description here"></p>