I've been using Code First approach. I created a sql express local database "Database.mdf" in Visual Studio 2010 SP1 using MVC 4 template. When I try to run my project at my PC, I get an error:
CREATE DATABASE permission denied in database master. Cannot attach the file "...Database.mdf" as database file "Database".
What I've tried:
deletion my database using SQL SERVER Object explorer(no results, the same error)
change connection string (no result, the same error)
googled in the Internet. However, I've met examples where people use real SQL servers, not the local DB.
My connection string is:
connectionString="Data Source=.\SQLEXPRESS; InitialCatalog=Database; AttachDBFilename=|DataDirectory|\Database.mdf; IntegratedSecurity=true;"
Please, pay attention that I use local database, not the real SQL SERVER and my Visual Studio is 2010.
I try to run this code:
WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true);
How to resolve it? Any help would be greatly appreciated!