Last post Nov 24, 2015 05:47 PM by madongeer
Nov 24, 2015 05:07 PM|madongeer|LINK
Hi, I hope I find help here!
In my web site project I have a database file in the App_Data folder when I double click it, it gives me the folloin error:
Unable to open the physical file "C:\Projects\WebSite\App_Data\Rox.mdf". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file C:\Projects\WebSite\App_Data\Rox.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Although there is no file with the same name, in this folder there are just two files: mdf file and the ldf file.
Nov 24, 2015 05:22 PM|PatriceSc|LINK
One part of the message is not about the file name but about a db with the same name that could already be part of the same instance (and maybe point to some other mdf file on your drive).
I would try
https://msdn.microsoft.com/en-us/library/hh272693(v=vs.103).aspx which should allow the SQL Server instance(s) you have and which database are used. If you have already a database named the same way you can see where it is by checking the "database properties"
(and you have the path to the db file somewhere).
Nov 24, 2015 05:47 PM|madongeer|LINK
Thanks for the quick reply.
But this doesn't support the auto-creating of the GridView and the SqlDataSource, instead it just add the text [dbo].[Genre] to the ASP page ('Genre' is the table name)
I'm following a tutorial which assume that if I double clicked the mdf file from the App_Data (which I created the database in from SSMS) it will open the database from
Server explorer (not SQL Server Object Explorer), and then when I double click a table under the database it should automatically create the GridView and the SqlDataSource.