I'm new to MVC technology, going though a training material and struck up with below error message with Entity Framework.
Here I'm trying to get one record from SQL Server Compact database but error occurs in EmployeeController
class at step:
Employee employee = empContext.Emp.Single(x => x.EmployeeID == id);
Error message:
Cannot attach the file 'E:\DotNet\MVC4Application\MVC4Application\App_Data\MVC4Application.Models.EmployeeContext.mdf' as database 'MVC4Application.Models.EmployeeContext'.
Exception Details: System.Data.SqlClient.SqlException: Cannot attach the file 'E:\DotNet\MVC4Application\MVC4Application\App_Data\MVC4Application.Models.EmployeeContext.mdf' as database 'MVC4Application.Models.EmployeeContext'.
Connection string:
<connectionStrings>
<add name="EmployeeContext"
connectionString="Data Source=E:\DotNet\MVC4Application\MVC4Application\App_Data\Database1.sdf;Persist Security Info=False"/>
</connectionStrings>
Could someone help me with this error message, please?