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!

40 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. Det finns flera stora och kända omnibus online-shoppingwebbplatser som Michael Kors Väska Rea. Dessa webbplatser är alla väldigt lättillgängliga och praktiska, de erbjuder Mikael Kors Väska med alla olika märken, stilar, priser och de kan strida mot de flesta köpare.

    (Läs källa: Michael Kors Plånbok,Michael Kors Väska Rea,Michael Kors Väska)

    För tjejer som vill ha speciella, ikoniska och högkvalitativa väskor från sina favoritdesigners, är det mest direkta och effektiva sättet att hitta den nyaste, hetaste och mest speciella designen på deras officiella webbplatser.

    (Läs källa: Sac Longchamp Femme,Sac Longchamp Pas Cher, Sac Longchamp Solde)

    Det finns verkliga butiker som säljer kvällssäckar på alla ställen, till exempel varuhus, designerbutiker eller sändningsaffärer. Fördelarna med att köpa i en butik är att du kan känna påsar i alla storlekar, du kan se om färgen matchar din klänning, eller om väskans storlek och vikt passar dina behov.

    (Läs källa: Michael Kors Bolsos,Bolsos Michael Kors Outlet,Bolsos Michael Kors Rebajas)

    ReplyDelete
  28. A pesar de que los bolsos MK son lo que he acuñado como "lujo asequible", una persona con los presupuestos más ajustados puede tener dificultades para comprar una bolsa por cien dólares o más.(Bolsos Michael Kors Rebajas) MK tiene bolsos que van de pequeño, mediano a grande. y varían en precios.(Bolsos Michael Kors Baratos) Los bolsos más pequeños ni siquiera son bolsos ... se llaman muñequeras.(bolsas michael kors precios) O, los uso para billeteras para ciertos bolsos.(Bolsos Michael Kors Outlet) Es mucho más barato hacerlo de esa manera que tratar de tener. una billetera para cada bolso MK que poseas.(bolsos michael kors rebajas)

    Om du planerar att äga en MK handväska och inte vill betala mycket över hundra dollar, är det bästa alternativet att vara den mindre väskan.(Michael Kors Plånbok)Om du är seriös om att hitta MK handväskor för mindre än du bättre tittar på någon annanstans.(MK Väska) Hemligheten att hitta MK handväskor till rabatterat pris är att handla online på en webbshop som säljer autentiska MK handväskor.(Väskor Michael Kors Rea) Du kan hitta bra handväskor till priser som du bara önskat att du kunde betala.(michael kors väska rea) Alla sökningar har gjorts för dig. Jag sparar inte bara pengar, utan också tid.(michael kors väska rea)

    Les sacs à main Longchamp sont à la mode et très pratiques.(Longchamp Soldes Destockage) Étant donné que beaucoup de femmes se retrouvent souvent submergées de choses à emporter chaque jour.(Sac A Main Longchamp) Longchamp a relevé le défi en créant des sacs à main qui sont aussi des fourre-tout polyvalents.(Sac Longchamp Pliage)Les sacs à main Longchamp sont des produits de qualité portant un nom réputé.(longchamp soldes) Les sacs à main Longchamp sont grands et spacieux, mais restent très à la mode et très demandés.(pronote college longchamp)

    ReplyDelete