gpt4 book ai didi

sql-server - Visual Studio 代码映射 : Unable to connect to the specified database

转载 作者:行者123 更新时间:2023-12-02 08:50:20 29 4
gpt4 key购买 nike

由于此错误,我无法在 Visual Studio 中使用代码图:

Unable to connect to the specified database.

An exception occurred attempting to connect to a database using the following connection string: Data Source=(LocalDB)\v11.0;AttachDbFilename=;Initial Catalog=master;Integrated Security=True;Enlist=False;Asynchronous Processing=True;MultipleActiveResultSets=True;Connect Timeout=30.

Check that the specified SQL Server instance exists and the service is running.

我读过这个问题,也遇到了同样的问题:

Code Map not working in VS2012

visual studio 2012 ultimate new dependency graph error

1) 我已经安装了SQL Server Data Tools for VS2012

2) 我已更新 VS,并重新安装了 SQL Server 组件(在默认卸载/修改/修复菜单中)

3)然后我成功停止并删除了本地数据库(如第二个问题):

sqllocaldb stop "v11.0" -k

sqllocaldb delete "v11.0"

但创建失败:

sqllocaldb create "v11.0"

Creation of LocalDB instance "v11.0" failed because of the following error:

The specified LocalDB version is not available on this computer.

但是创建并启动另一个版本成功了:

sqllocaldb create "v12.0"

LocalDB instance "v12.0" created with version 12.0.2000.8.

sqllocaldb start "v12.0"

LocalDB instance "v12.0" started.

现在我很困惑到底出了什么问题。每一步之后我都重新启动 VS 并尝试使用图表 - 但没有任何改变。

如何解决这个问题?

最佳答案

这对我有用:

删除、创建、启动CodeMap使用的localDB实例:

%localappdata%\Microsoft\Microsoft SQL Server Local DB\Instances\MSSQLLocalDB

使用这些命令:

sqllocaldb stop "MSSQLLocalDB" -k
sqllocaldb delete "MSSQLLocalDB"
sqllocaldb create "MSSQLLocalDB"
sqllocaldb start "MSSQLLocalDB"

然后重启VS

关于sql-server - Visual Studio 代码映射 : Unable to connect to the specified database,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23154763/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com