views:

70

answers:

3

Hi,

We're getting the following error when trying to establish a connection to a database file in the project:

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.

Any ideas on how we can fix it?

Thanks in advance!

+1  A: 

http://jeremywadsworth.com/Default.aspx?blogentryid=56 has one possible fix.

http://forums.asp.net/t/1377174.aspx also has further discussion on the topic.

Hope that helps.

--

One more idea. I think I've encountered something like this when using Visual studio to create and access my database. You can detach your database file from visual studio and then directly attach it to your SQL server. I can't remember if the problem manifested in the same way or not but this should get you around the user instance issue. If this doesn't apply let me know and I'll see if i can come up with anything else.

apocalypse9
We're currently testing this solution (deleting the SQLExpress folder)
stringo0
We've tried this, and it is not solving the problem :[
stringo0
Update on the second suggestion - I think the db was created in visual studio - we are able to access it in SQL Management Studio Express, but not in Visual Studio itself - it's weird. (On one machine it's fine, but not on the other)Also, the solution builds and runs successfully - it's able to access the database while it's actually running.
stringo0
A: 

SQL Express file attach starts a new 'user instance' SQL Server. This involves a new master/model/msdb/tempdb set of files that are created in the user settings data folder. also the startup of the new 'user instance' can take up to several minutes on extreme cases.

This MSDN article on SQL Server 2005 Express Edition User Instances cover in detail the process and luckly it has some Common Issues and fixes. The most common failure is due to access rights over the user settings copied files. You will usualy get details about the failure in your NT event log (ie. why did the child instance not start).

Remus Rusanu
A: 

We got over this by copying the database from my machine to my team-mate's.

stringo0