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 Compact database but error occuring 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:

Could someone help me with this error message, please.

Related posts

Recent Viewed