O'Reilly logo

Fluent Entity Framework by Rebecca M. Riordan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using connection strings

Passing the database name to the context constructor is simple if that’s all you need to do, but you may want (or need) more control than that. Remember that Entity Framework is part of ADO.NET, and when you’re working the Code First, you can use a ADO.NET standard connection string that specifies everything you need.

The exact structure of your connection string depends on the database server and of course the details depend on your development and deployment environment. I’m afraid that’s outside our scope. (And frankly, outside my area of expertise. There are a lot of database servers out there that I don’t have recent experience with.) But assuming you know what your connection string needs to look like, here are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required