title: The process cannot access the file '.mdf' because it is being used by another process
body: <p>I use the ASP.NET Dynamic Data web template with an SQL Server 2008 database and when I try to add <code>.mdf</code> file in <code>App_Data</code> I get </p>
  
  <blockquote>
    <p><em>The file cannot be opened because it is being used by another process.
    Please close all applications that might access this file and try again</em></p>
  </blockquote>
  
  <p>I try find solutions but its very different </p>
  
  <blockquote>
    <p>Hi Ken, this is because you are trying to add your DB to the project
    (i.e. copy it there) not connect to it, to connect add a Entity
    Framework data model and then select your Data base and all should go
    well.</p>
    
    <p>If you actually want to have the DB in the App_Data folder then you
    will need:</p>
    
    <p>To have SQL Server Express installed locally and on your web server.
    Temporarily stop your SQL Server so that the DB is accessible then
    copy it to the App_Data folder.</p>
  </blockquote>
  
  <p>Or </p>
  
  <blockquote>
    <ol>
    <li><p>Go to SQL Server Configuration Tools and stop the SqlserverExpress Service.</p></li>
    <li><p>In Solution Explorer a Right click on project add existing Item
    ., Go to Program files and search for you required <code>.mdf</code> file in it add
    it to Project.</p></li>
    <li><p>Goto SQL Server Configuration tools start the Sqlexpress Service.</p></li>
    <li><p>Run Your solution.</p></li>
    </ol>
  </blockquote>
  
  <p>How I can resolve my issue?</p>