Saturday 7 May 2011

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

After my fun with trying to get VS, SQL and Phone Tools all working together, I had the following error trying to mount databases:

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

If you get that error message, the solution that worked for me was to clear the SQL Express user instance data store, located at:

%userprofile%\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
(or full path)

C:\Users\\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS

Hope this helps someone!

38 comments:

  1. thank you that's work for me

    ReplyDelete
  2. HI I like to share what I found.
    I tried what you and many of them said but I couldn't get it done properly. I worked with the .mdf database file not connect with the SQL Server so all I have done change the
    connection string to this

    @"Data Source=.;AttachDbFilename=" + Server.MapPath("~/DATABASE_NAME") + @";Integrated Security=True;Connect Timeout=30;User Instance=True";

    instead
    .\SQLEXPRESS
    I used this
    .
    then it worked. also it can be done with Server Explorer-> Add New Connection-> Select SQL Database File or something then go to Advance and replace .\SQLEXPRESS with . that's all.

    if someone has any trouble regarding this so this might be the solution for you if non of things worked.

    ReplyDelete
    Replies
    1. Thanks, works like a charm....

      Delete
    2. still i can not create database. what can i do?

      Delete
  3. Thanks, It was really helpful...

    ReplyDelete
  4. Thanks. It worked just fine

    ReplyDelete
  5. Thanks. It worked just fine

    ReplyDelete
  6. Superb, that simple suggestion worked first time, all of the complicated ones from elsewhere didn't.

    Thank yoy.

    ReplyDelete
  7. Thanks !your suggestion worked..

    ReplyDelete
  8. worked. thanks! :)
    but.. what did it do?

    ReplyDelete
  9. thank you very much!
    it worked fine

    ReplyDelete
  10. Appdata doesn't appear

    ReplyDelete
  11. Wont let me modify it

    ReplyDelete
  12. Worked fine for me. Thanks

    ReplyDelete
  13. Worked well thnx

    ReplyDelete
  14. Worked for me!! THX

    ReplyDelete
  15. Gryphes, I did what you have told,but its showing the following error,

    "A network related or instance-specific error occured while establishing the connection to the SQL Server...."

    What shall I do now?

    ReplyDelete
  16. William what shall be the full path for Windows XP?

    ReplyDelete
  17. thank you very much... it worked:)

    ReplyDelete
  18. it works!
    Thanks

    ReplyDelete
  19. Worked for me! Thanks a lot! =)

    ReplyDelete
  20. Nice, thanks it worked.

    ReplyDelete
  21. Can you anybody tell me how to create database in vs 2010 project inbuilt ?

    ReplyDelete
  22. How to create .mdf database in vs 2010 ?

    ReplyDelete
  23. Thanks, It's Work successfully........

    ReplyDelete
  24. worked, thanks!!

    ReplyDelete
  25. its not working for me
    ....i have deleted the contents...bt still it is not working

    ReplyDelete
  26. There is an inclination to trust that loan specialists are fixated using a credit card scores, however this is untrue. We are cautioned about our record of loan repayment to urge us to keep up our reimbursement plans, however banks are more enthusiasm for different elements. Check Cashing San-diego

    ReplyDelete
  27. "We can't wait for the fall season and the chance to roll out our lineup of distinctive, innovative new dramas and comedies, scheduled with the kind of lead in support that will give each of our new shows the optimum chance to find their audiences Coach Bags Outlet and deliver on their outstanding potential," said Jennifer Salke, President, NBC Entertainment. "The fall lineup Michael Kors Outlet Store gives you only half the story. We truly program on a 52 week basis and are putting virtually the same amount of programming muscle behind our mid season lineup, with some of the most high profile concepts and biggest Coach Outlet Clearance names on television joining the schedule starting at midseason and extending throughout the remainder of the broadcast year.".

    Priyanka Chopra is beautiful and with that I just said one of the most redundant things ever. But we all know that behind those gorgeous looks, those public appearances, there is a team of stylists and beauticians who work hard to bring the best out of her. For celebrities, looking good is MK Outlet a full time occupation as Priyanka points out to New Yeezys 2020 Bazaar, she's "literally photographed every day." And it's Cheap Ray Ban Glasses not always in a celeb's control, what with the paparazzi, the shutterbugs, the phone cameras everywhere, you never know where you will get photographed and New Jordan Shoes 2020 Coach Bags Clearance make Nike Air Force 1 Cheap Outlet it to the headlines the next day.

    ReplyDelete