Used for a long time localdb, do not have so many SQL components feel very good, not long before debugging code encountered a problem, vs suddenly connected not to LocalDB, pondering the afternoon, in fact, there is a very simple method.
The first step is to find the SQL Local DB version, I use VS2013, so it is V11.0, or can be played in CMD sqllocaldb versions
In this case, the default instance is v11.0, of course, if you do not use this instance of the project, then it is not necessary.
The second step, find the instance of the folder, I use the WIN8 system, my path is C:\Users\ user name \appdata\local\microsoft\microsoft SQL Server Local DB There is a instances folder underneath this folder, which is all the current instances.
The third step, in the CMD to delete the current project start instance, if it has been started, then stop, I use v11.0.
This will remove the success, if the prompt fails, skip to the next step.
Fourth, delete the deleted instances folder under the LocalDB path. If the third step is completed properly, then the instance folder under the instances only a few log files, delete this folder is OK, if the third step is wrong, can not delete the situation, then directly delete this folder, do not control the other.
The fifth step, the deletion is complete, then you can re-create, the name and just deleted the same line. -S means that the direct launch instance is created. If you do not add the-s parameter when you create it, start the instance yourself when you are finished creating it.
This is done, generally for localdb common errors, such as error codes 23, 40, 50 can be resolved.