I was running my application in Visual Studio 2010 Application Server, but now I have changed it to use IIS Local Server, then everything crushed. I am getting following error:
System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file D:\Code\EMSApplication\EMSApplication.Web\App_Data\ASPNETDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
I have changed the setting of Application Pool of the Default Web Site of IIS to Classic .NET AppPool.
Also changed the Identity of the Classic .NET AppPool to LocalSystem.
I also set the permission of the NETWORK SERVICE to the Full
The connection string is:
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.mdf;Integrated Security=True
But none of them worked. I am still getting that error. Any suggestion will be very helpful to me.
Thanks.
I am using SQL Server 2008 Express which comes with the installation of Visual Studio 2010.