1

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!

2
  • What edition & version of SQL Server are you using? Commented Aug 10, 2009 at 16:00
  • Did you create the database using visual studio? If so I've added another potential solution to my answer. Sorry the other answer didn't work out. Commented Aug 10, 2009 at 17:25

4 Answers 4

1

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.

2
  • We're currently testing this solution (deleting the SQLExpress folder)
    – stringo0
    Commented Aug 10, 2009 at 16:20
  • 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
    Commented Aug 11, 2009 at 16:56
1

If you are using IIS as the server,then this occurs because the server takes default asp.net database. In IIS server,create your own application pool and run your app on that instead of using the default pool.

Check the permissions.Give full access control rights.

Also, go to SQL server configuration>properties. Select local system in the built-in app.. And your new pool should also have local system selected.

This fixed the problem for me. Hope it works for someone here.

PS: If you are trying to making connectivity in Visual studio for android application,then close the visual studio before running it on android as the process wont complete if visual studio is open and will result into error.

0
0

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).

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.