Search code examples
entity-framework-4ef-code-first

How to specify database name in Code First?


How do I tell EF what to name the database and where to put it?

If there is no connection string in the Web.Config, it tries to put it in the local SQLEXPRESS Server, but I want to put it out on a known SQL Server and name it what I want. Any suggestions?


Solution

  • Create a connection string in the app.config/web.config with the same name as the context and the EF will use that DB.