Entity Framework 4.3 with SQL Server Express Migration Exception
I have installed (remote) SQL Server Express for my ASP.NET MVC with Entity Framework 4.3 project. On my local machine using SQL Compact, everything works fine. When I try to connect to the SQL Express server I got the following error when called migrator.Update()
:
The INSERT permission was denied on the object '__MigrationHistory', database 'MyDataBase', schema 'dbo'.
On the server, I did the following:
- Created a user with SQL Server credentials
- Created a database called MyDataBase
Any ideas?
+3
Marthijn
source
to share
2 answers
The role of the DB db_denydatareader
, db_denydatawriter
should be marked for the newly created user.
+5
Mano nandu
source
to share
I was getting this error too. To fix this, I added db_owner to my custom "Role Role Membership" and checked the db_owner checkbox under Schemes Owned by This User (SSMS 2008).
+1
RepDbg
source
to share