I have created a generic repository project using Entity Framework 4.1 and it works great with my projects when added as an existing project to them but it doesn't work on them when just referenced as dll.
I get this error
CREATE DATABASE permission denied in database 'master'.
but I have added
app.config file and set relevant connection string to my SQL Server 2005 database (I have used
DbContext as type my context)
Please help me.
Here is my connection string :
<configuration> <connectionStrings> <add name="TasksEntities" connectionString="server=(local); database=Tasks; trusted_connection=false; User=sa; Password=****; Persist Security Info=True" providerName="System.Data.SqlClient"/> </connectionStrings> </configuration>
I just ran into this myself. The connection string name must match the class name of your DbContext subclass exactly. If it doesn't EF will not find the connection string and will try and fall back to doing something else (SQL embedded?) which doesn't work on my machine (I have full SQL Server installed).