When transferring a project from one PC to another, a SqlException occurred, I checked the project on the first PC and everything works again, but nothing works on the second one. On both costs SqlExpress 2012.

Additional information: Connection timed out. Timeout expired on the stage after the entrance. It is possible that the connection timed out while the server was performing the login process and sending a response, or it happened while trying to create several active connections. The time spent trying to connect to this server was: [Pre-Login] initialization = 634; handshake = 1827; [Login] initialization = 0; authentication = 46; [Post-Login] complete = 13069;

Connection string:

<connectionStrings> <add name="userStore" connectionString="Data Source=.\SQLEXPRESS;Integrated security=SSPI;AttachDBFilename=|DataDirectory|\DataBase\UserStore.mdf;User Instance=True" /> </connectionStrings> 
  • I had a similar problem, it turned out that the SQLExpress configurations diverge, I advise you to check all the installed functionality as follows - Fox
  • Check the server name Data Source =. \ SQLEXPRESS - MoHcTpUk
  • Check server logs (at least in Event Log). Judging by the error, the connection was broken at Post-login, so the server had to write a specific message to the log. - PashaPash
  • @ Alexey, did you solve your problem? - MaximK

1 answer 1

Try setting Connection Timeout = 30. The result should be the following connection string:

 <connectionStrings> <add name="userStore" connectionString="Data Source=.\SQLEXPRESS;Integrated security=SSPI;Connection Timeout=30;AttachDBFilename=|DataDirectory|\DataBase\UserStore.mdf;User Instance=True" /> </connectionStrings>