I have an MVC4 application with an aspnet.mdf database with membership tables and I’ve added two more tables to it. Locally I’m using “AccountModels.cs” to handle membership and a Database first EDMX modal to handle the two other tables. So I have two connection strings that are working great locally.
Remotely, my Database first EDMX modal "aspnetEntities" connection string works fine but I don’t know what I need to do to get the "DefaultConnection" connection string to work, this is what I had hoped would work:
Remote DefaultConnection not working
<add name="DefaultConnection" connectionString="Data Source=mydatabase.db.3730456.hostedresource.com; Initial Catalog=mydatabase; Persist Security Info=True; MultipleActiveResultSets=True; User ID=mydatabase; Password=mypass" providerName="System.Data.SqlClient"/>
Locally it looks like this, but it's generated for me when I add the EDMX
<add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\aspnet.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
And my working remote aspnetEntities connection string
<add name="aspnetEntities" connectionString="metadata=res://*/Models.RegisterModel.csdl|res://*/Models.RegisterModel.ssdl|res://*/Models.RegisterModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=mydatabase.db.3730456.hostedresource.com; Initial Catalog=mydatabase; User ID=mydatabase; Password='mypass'"" providerName="System.Data.EntityClient" />
When I try to run the membership part of the site remotely, I get an error saying it’s trying to build a new database,
CREATE DATABASE permission denied in database 'master'.
Can someone help me out with a connection string that will work?