There are a couple of reasons for getting this error when using Code First approach in Entity Framework
Reason 1: The name of the connection string does not match the name of the Entity Framework Context.
Example: The name of my EF context JobBoardContext does not match the name of the connection string which is JobBoard.

Reason 2: Entity Framework was unable to make a connection to the database. Take a look at the inner exception to get more details about the
exception.
Reason 1: The name of the connection string does not match the name of the Entity Framework Context.
Example: The name of my EF context JobBoardContext does not match the name of the connection string which is JobBoard.

![]() |
Check the inner details of the exception to know more details about the connection error |
Comments