I'm using Sql Server Compact Edition v4 with EntityFramework v5. I pass the name of the sdf file into the constructor of my various DbContext inheritors. It works fine but always creates the files in ./App_Data. On my deployed server I want it to create the files in ../../data. Can I specify that data directory as part of the connection factory settings in the web.config? Or if I use a connection string, can I specify some kind of wildcard for the filename itself so that it continues to use the runtime-generated value passed to the DbContext constructor?
-
Possible duplicate - EF 5 + SQL CE 4: How to specify custom location for database file?Patrick D'Souza– Patrick D'Souza2013-04-26 15:35:23 +00:00Commented Apr 26, 2013 at 15:35
-
That example is not ideal because it uses CE-specific code. SQL CE is not my long-term solution; it's an intermediate hack that I hope will last until my host solution can support LocalDb.Brannon– Brannon2013-04-27 03:31:28 +00:00Commented Apr 27, 2013 at 3:31
Add a comment
|