CREATE DATABASE permission denied in database 'master'. An attempt to attach an auto-named database for file C:\Documents and Settings\..\App_Data\HelloWorld.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
I've found these links:
Generally the user that you are using to run the SQL Server service will not have access to your personal user folders, that is why you're getting the error. You either need to change the credentials used for the service, or move the database to another folder, which did the trick in your case.
For me helped a lot to set this tag under system.web tag on the web.config file:
<system.web>
<identity impersonate="true" userName="admin_user" password="admin_password" />
...
Hope this can help somebody
I was stuck on this today with compound issue in mvc3 and entity framework code first.
My SqlExpress install is messed up (permissions issues) so I switched to SqlCE.
My ConnectionString.Name attribute didn't match my "ProjectNameContext" class name.
When the connection string isn't found, it uses default conventions. Default conventions means my SqlExpress service with a database name like "ProjectNameContext". The permissions are messed up on that so I got a permissions error on SqlExpress when I thought I was using SqlSE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With