Alex Rivera | Logout

How to specify database name in Code First?

Asked 2011-03-18T00:52:01.913
62

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?

Edit
Report

1 Answer

65

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

answered 2011-03-18T00:59:28.827

Your Answer