EF code-first will use a connection string with the same name as your DB context, so you can define it like this:
<connectionString> <add name="EfDbContext" connectionString="server=YourServer;database=YourChoice;Integrated Security=SSPI;" /> </connectionString>
The database will not be created by default until you actually do nothing, for example. it should appear as soon as you make the call to EfDbContext.SaveChanges() for the first time.
It will be called the same as your DB context ( YourNamespace.EfDbContext ) if you did not specify your own custom connection string and it should appear in your local SQL instance by default.
See the ADO.NET EF 4.1 section . First walkthrough :
Where is my data?
By convention, DbContext created a local \ SQLEXPRESS database for you. The database is named after the fully qualified name of your derived context, in our case, which is "CodeFirstSample.ProductContext". See how to change this later in the walkthrough.
source share