I am using Entity Framework 5.0 code first to create my database. This framework works fine and creates a database on my local instance of mysql. However, if I try and point at a sql server on my remote server then I have found many difficulties. I have changed the connection string and also used this code below in the DBContext constructor (DBRisk) so that I am pointing at my remote database.
public RiskDB()
{
this.Database.Connection.ConnectionString =
"Data Source=Data Source=217.111.222.194;Initial Catalogue=RiskDB;User ID=xxx;Password=yyy";
}
I have followed the advice on stackoverflow and had no resolution
This is the error - it seems to indicate it is targeting a sql ce database. I don’t know how to address this and migrate to the correct remote database as the connection string is configured correctly. The permission on the database are ok for database creation
Error
Checking if the context targets an existing database...
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Keyword not supported: 'initial catalogue'. at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) Exception has been thrown by the target of an invocation.
This error happens when the connection string is configured for SQL Server and the migrator provider is configured for SQLCE.