相关疑难解决方法(0)

visual studio 2012终极新依赖图错误

每当我创建一个新的依赖图时,使用visual studio 2012终极版我会收到此错误:

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.
Run Code Online (Sandbox Code Playgroud)

我的解决方案正确构建,我的连接字符串是这样的:

<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=.;Initial Catalog=JewelryStore;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
</connectionStrings>
Run Code Online (Sandbox Code Playgroud)

这里有什么问题?

visual-studio-2012

8
推荐指数
1
解决办法
2630
查看次数

为解决方案生成代码图 - 无法连接到指定的数据库

我正在尝试使用 Visual Studio 2017 Enterprise 生成代码映射,但收到以下错误:

在此处输入图片说明

请注意数据源:Data Source=(LocalDB)\MSSQLLocalDB。当我在我的解决方案中搜索 MSSQLLocalDB 时,什么也没有出现。我的应用程序不使用 SQL Server 2016(这是我认为连接字符串的用途)。它使用 2012。我所有的连接字符串都使用 (localdb)\v11.0。

我尝试过的修复/注释:

  • 我试图查看 XML 文件,但“打开 XML 编辑器”只是关闭了 Visual Studio 中的 .dgml 文件。
  • 更改 Visual Studio 的数据连接(工具 -> 选项 -> 数据库工具 -> 数据连接)不起作用:

在此处输入图片说明

  • 安装 SQL 服务器组件。大多数可以在 Visual Studio 安装程序中找到的 SQL Server 组件已经安装:

在此处输入图片说明

  • Visual Studio 是最新的: 在此处输入图片说明

  • 我见过这个问题。不仅是 VS2012 的问题,解决方案也适用于 web.config。我的应用程序是桌面应用程序,所以没有 web.config。但无论如何,项目的 app.config 都不包含对 (LocalDB)\MSSQLLocalDB 的引用。

  • 考虑到这可能与最新版本的 SSDT (15.8.1) 不再支持 SQL Server 2012 有关,我检查了版本。它是 15.1.6: 在此处输入图片说明

Visual Studio 在 Windows 7 Ultimate、SP1、64 位上运行。

编辑

我正在将 SQL Server express …

visual-studio visual-studio-2017

5
推荐指数
1
解决办法
397
查看次数