I am using Entity Framework 4.1 and try to connect to a new SQLServerCE 4.0 database inside an MVC Web application. I am using this code
Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0", "|DataDirectory|", "test.sdf");
And it raises this exception :
Format of the initialization string does not conform to specification starting at index 86.
What's wrong with this code?
If I use
Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0")
It works and creates a database with a very long name matching my assembly name.