I am having a strange problem. I have a web application and it is fetching data from Northwind database which is downloaded and attached to sql express 2008. When I execute the web application from VS2008 it is working fine. But when I publish the website and browse from there I am getting a permission error, as follows.
CREATE DATABASE permission denied in database 'master'. Cannot attach the file 'D:\SQL Server 2000 Sample Databases\NORTHWIND.MDF' as database 'Northwindd'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'. Cannot attach the file 'D:\SQL Server 2000 Sample Databases\NORTHWIND.MDF' as database 'Northwindd'.
I dont understand why is this happening. I gave permission to Northwind.MDF for 'Everyone', even then its not working.
Your web app user needs to have dbcreator rights. Alternatively, just attach the database and leave it attached - user instances aren't around for the long haul anyway, so you may as well pull the user instance code out now, while you're working on it.Aaron Alton | thehobt.blogspot.com
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.