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 .mdf
file to the App_data
folder and used this connection string:
<add name="dbCanberraConnectionString1"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|latestcanberra.mdf;"
providerName="System.Data.SqlClient" />
in web.config
. But when I tried to run my website it shows an error
Unable to open the physical file "D:\Complete Assignment\Alkandi Final Work\App_Data\latestcanberra.mdf". Operating system error 5: "5(Access is denied.)
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.
I am totally stuck with this error from last 3 hours even I tried different methods by searching solutions from different blogs etc
Any idea how to solve this out within less time ?