Entity Framework 6 Code First to RDS trying to Create Database

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


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"?>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx" requirePermission="false" />
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
          <parameter value="Server=[xxxxxxxxxx].rds.amazonaws.com,1433;Database=[xxxxxxxxxx];UID=[xxxxxxxxxx];PWD=[xxxxxxxxxx]" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    <add name="DataModel" connectionString="Server=[xxxxxxxxxx].rds.amazonaws.com,1433;Database=[xxxxxxxxxx];UID=[xxxxxxxxxx];PWD=[xxxxxxxxxx]"/>

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

5/9/2017 7:39:37 PM

Accepted Answer

5/9/2017 8:47:05 PM

Related Questions


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