Entity Framework 6 Code First to RDS trying to Create Database

amazon-rds c# entity-framework entity-framework-6 sql-server

Question

I want to use the Entity Framework to push some existing code from an existing database that I already have (v6.0.0.0).

I can connect to the database without any issues, and after looking through the context and migrations files, I think everything is in order.

If I use theUpdate-Database -Verbose command, I get the accompanying error:

CREATE DATABASE permission denied in database 'master'.

Since there is already a database and I have specified the database in the options, I'm not sure why it is even attempting to establish one.

My app.config is shown here:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx" requirePermission="false" />
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
  </startup>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
      <parameters>
          <parameter value="Server=[xxxxxxxxxx].rds.amazonaws.com,1433;Database=[xxxxxxxxxx];UID=[xxxxxxxxxx];PWD=[xxxxxxxxxx]" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <connectionStrings>
    <add name="DataModel" connectionString="Server=[xxxxxxxxxx].rds.amazonaws.com,1433;Database=[xxxxxxxxxx];UID=[xxxxxxxxxx];PWD=[xxxxxxxxxx]"/>
  </connectionStrings>
</configuration>

Any explanation as to why it would be attempting to start again instead of using my DB name?

1
0
5/9/2017 7:39:37 PM

Accepted Answer

ZZZ_tmp
1
5/9/2017 8:47:05 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