Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed

asp.netsql-server-express

I've attempted to add a "service based data base" (.mdf) to a project in an asp .net application. From there I've proceeded attempted to create an entity framework model file (.edmx).

When doing so I get the error:

An error occurred while connecting to the database. The database might be unavailable. An exception of type 'System.Data.SqlClient.SqlException' occurred. The error message is: 'Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.'.

I've got SQL Server 2008 R2 Express edition installed on my machine.

Any ideas would be most appreciated.

Best Answer

I have got the same error, it's fixed after the following change.

Deleting the folder C:\Users\User\AppData\Local\Microsoft\Microsoft SQL Server Data worked for me in Windows 7. Have to restart VS after deleting the folder.

Related Topic