Created
May 11, 2012 10:07
-
-
Save johnw86/2658732 to your computer and use it in GitHub Desktop.
Entity Framework connections for both SQL CE and SQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sql CE - Database name will be set based on the DbContext inherited class | |
//If no App_Data folder exists you need to create it | |
Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0"); | |
//Uses default conn string but setting a connection string in config with the name of the context will override conn string | |
Database.DefaultConnectionFactory = new SqlConnectionFactory(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment