Unable to create edmx

Jan 10, 2011 at 1:40 PM
Edited Jan 10, 2011 at 1:45 PM

When trying to create StoreDB.edmx I am receiving the following error:

"An error ocurred 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 use regular SQL Server not SQLExpress.

Any clue what is the problem? Thank you in advance.

Jan 10, 2011 at 6:08 PM
Edited Jan 10, 2011 at 6:10 PM

Can you include the connectionStrings section of your web.config? It seems like your connection may be incorrect. http://connectionstrings.com/ is a good resource for determining the correct connection string.

Alternatively you can use the Server Explorer window in Visual Studio to connect to the database.

Jan 11, 2011 at 3:00 PM

Hi jongalloway,

Thanks for your reply

This is the connection string:

Data Source=.\SQLExpress;AttachDbFilename=C:\Projects\MvcMusicStoreEmpty\MvcMusicStoreEmpty\App_Data\MvcMusicStore.mdf;Integrated Security=True;User Instance=True

The problem I think is that I don't have SQL Server Express installed. I have a regular licensed installation of SQL Server 2005. What I did to overcome my problem for now is

that I create in my DB the tables used for this project and I working with the DB directly, without using what is in App_Data. 



Jan 11, 2011 at 5:46 PM

Okay - as long as you have a working database that you can access from your MVC application, the application itself should function just fine. Sounds like you've got this sorted out, then.