code first entity framework 4.1 The permission to CREATE DATABASE was refused in the database'master.'

entity-framework

Question

Using Entity Framework 4.1, I made a generic repository project that works perfectly with my projects when added as an existing project, but it doesn't function with them when only referred as a dll.

I experience this error

CREATE DATABASE permission denied in database 'master'.

although I've addedapp.config I utilized a file and set the appropriate connection string to my SQL Server 2005 database.DbContext inputting my context)

Please assist me.

My connection string is as follows:

<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>
1
5
11/18/2012 10:02:33 AM

Popular Answer

I recently encountered this issue. Your DbContext subclass's class name must precisely correspond to the connection string's name. If it doesn't, EF won't be able to locate the connection string and will attempt to fall back to an other method (SQL embedded? ), which is ineffective on my computer (I have full SQL Server installed).

7
3/22/2012 2:32:45 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow