I've been using a localDB named 'Projects' for a while now. This is the same database that is created by default ASP.NET MVC 5 project. However, suddenly it stopped and I'm not able to connect to it nor restart it using
SqlLocalDb start Projects
I get
The specified LocalDB instance does not exist.
I see the folder in
C:Users[My UserName]AppDataLocalMicrosoftMicrosoft SQL Server Local DBInstancesProjects
also, I have v11.0 in
C:Users[My UserName]AppDataLocalMicrosoftMicrosoft SQL Server Local DBInstancesv11.0
I'm able to connect to v11.
What else can I try to reconnect to it?
The connection string is
<add name="DefaultConnection" connectionString="Data Source=(localdb)Projects;Initial Catalog=master;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False" providerName="System.Data.SqlClient" />
Edit
I tried Attaching the Db file to the connection string
AttachDbFileName=C:Users[My UserName]AppDataLocalMicrosoftMicrosoft SQL Server Local DBInstancesProjectsmaster.mdf;
However, I'm still not able to connect
A network-related or instance-specific error occurred while establishing a connection to SQL
Server. The server was not found or was not accessible. Verify that the instance name is correct
and that SQL Server is configured to allow remote connections. (provider: SQL Network
Interfaces, error: 50 - Local Database Runtime error occurred. The specified LocalDB instance
does not exist.)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…