title: Unable to open the physical file failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share
body: <p>I have developed and website as for my assignment purpose and then my teacher asked me that he doesn't have SQL Server to run separately my database file so I must have to make built in database. I then added the <code>.mdf</code> file to the  <code>App_data</code> folder and used this connection string:</p>
  
  <pre><code>&lt;add name="dbCanberraConnectionString1"
       connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|latestcanberra.mdf;"
       providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p>in <code>web.config</code>. But when I tried to run my website it shows an error </p>
  
  <blockquote>
    <p>Unable to open the physical file "D:\Complete Assignment\Alkandi Final Work\App_Data\latestcanberra.mdf". Operating system error 5: "5(Access is denied.) </p>
    
    <p>An attempt to attach an auto-named database for file D:\Complete Assignment\Alkandi Final Work\App_Data\latestcanberra.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.</p>
  </blockquote>
  
  <p>I am totally stuck with this error from last 3 hours even I tried different methods by searching solutions from different blogs etc</p>
  
  <p>Any idea how to solve this out within less time ?</p>