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

thank you that's work for me
ReplyDeleteHI I like to share what I found.
ReplyDeleteI 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.
Thanks, works like a charm....
Deletestill i can not create database. what can i do?
DeleteThanks, It was really helpful...
ReplyDeleteThanks. It worked just fine
ReplyDeleteThanks. It worked just fine
ReplyDeleteSuperb, that simple suggestion worked first time, all of the complicated ones from elsewhere didn't.
ReplyDeleteThank yoy.
Thanks !your suggestion worked..
ReplyDeleteworked. thanks! :)
ReplyDeletebut.. what did it do?
thank u boss
ReplyDeletethank a lot
ReplyDeletethank you very much!
ReplyDeleteit worked fine
Appdata doesn't appear
ReplyDeletecheck inside admin
Deleteyou da maan
ReplyDeleteWont let me modify it
ReplyDeleteWorked fine for me. Thanks
ReplyDeleteWorked well thnx
ReplyDeleteWorked for me!! THX
ReplyDeleteThank you very much...
ReplyDeleteGryphes, I did what you have told,but its showing the following error,
ReplyDelete"A network related or instance-specific error occured while establishing the connection to the SQL Server...."
What shall I do now?
William what shall be the full path for Windows XP?
ReplyDeletethank you very much... it worked:)
ReplyDeleteit works!
ReplyDeleteThanks
Worked for me! Thanks a lot! =)
ReplyDeletethank you it works !!
ReplyDelete