在 Visual Studio 中创建基于服务的数据库
Creating a Service Based Database in Visual Studio
我在 Visual Studio 2013 社区创建基于服务的数据库时遇到问题。
基本上,问题是当我尝试将基于服务的数据库添加到我的任何项目时,我收到一条错误消息:
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.
Cannot create an automatic instance. See the Windows Application event
log for error details)
过去,我能够毫无问题地将数据库添加到我的项目中。现在发生的变化是我开始使用 SQL Server 2014 来处理 Java 项目。我假设安装 SQL Server 2014 更改了一些配置设置,这些设置现在阻止我在 Visual Studio.
中创建本地数据库
我能够通过将服务器名称(通过工具>选项>数据库工具>数据连接在 Visual Studio 中配置)更改为 SQLEXPRESS 来解决这个问题,并且能够创建一个数据库,但是,当我从数据库创建数据源时,在收到消息之前我已经到了最后一步:
Could not load file or assembly
'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0,
Culture=neutral, PublicKeyToken or one of its dependencies. The system
cannot find the file specified
下载了一些文件并安装后,我没有看到任何效果。我真的仍然想使用本地数据库,在尝试 return 回到使用本地数据库后,我根本无法使用任何东西。现在,无论我尝试什么,我都会收到错误消息:
A network-related or instance-specific error occured while
establishing a connection to SQL Server. The server was not found or
wa not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified)
如果我想在 Visual Studio 中使用本地数据库,是否可以安装 SQL Server 2014?如果是这样,我有什么地方出错了吗?
非常感谢您提供的任何帮助。
好的,我设法解决了我的问题。
要创建本地数据库,我必须使用 SQL 服务器实例名称 (localDB)\v11.0 并安装 2012 LocalDB。看起来好像安装 SQL Server 2014 将 LocalDB 的 2012 版本更新为 2014 版本,Visual Studio 2013 不兼容。
感谢大家的帮助,但没有人可以感谢。
尝试 运行 Visual Studio 2013 作为管理员。它对我有用。
我在这里 ( A network-related or instance-specific error occurred while establishing a connection to SQL Server ) 发现错误与访问数据库的权限有关。
我在 Visual Studio 2013 社区创建基于服务的数据库时遇到问题。
基本上,问题是当我尝试将基于服务的数据库添加到我的任何项目时,我收到一条错误消息:
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. Cannot create an automatic instance. See the Windows Application event log for error details)
过去,我能够毫无问题地将数据库添加到我的项目中。现在发生的变化是我开始使用 SQL Server 2014 来处理 Java 项目。我假设安装 SQL Server 2014 更改了一些配置设置,这些设置现在阻止我在 Visual Studio.
中创建本地数据库我能够通过将服务器名称(通过工具>选项>数据库工具>数据连接在 Visual Studio 中配置)更改为 SQLEXPRESS 来解决这个问题,并且能够创建一个数据库,但是,当我从数据库创建数据源时,在收到消息之前我已经到了最后一步:
Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0, Culture=neutral, PublicKeyToken or one of its dependencies. The system cannot find the file specified
下载了一些文件并安装后,我没有看到任何效果。我真的仍然想使用本地数据库,在尝试 return 回到使用本地数据库后,我根本无法使用任何东西。现在,无论我尝试什么,我都会收到错误消息:
A network-related or instance-specific error occured while establishing a connection to SQL Server. The server was not found or wa not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
如果我想在 Visual Studio 中使用本地数据库,是否可以安装 SQL Server 2014?如果是这样,我有什么地方出错了吗?
非常感谢您提供的任何帮助。
好的,我设法解决了我的问题。
要创建本地数据库,我必须使用 SQL 服务器实例名称 (localDB)\v11.0 并安装 2012 LocalDB。看起来好像安装 SQL Server 2014 将 LocalDB 的 2012 版本更新为 2014 版本,Visual Studio 2013 不兼容。
感谢大家的帮助,但没有人可以感谢。
尝试 运行 Visual Studio 2013 作为管理员。它对我有用。
我在这里 ( A network-related or instance-specific error occurred while establishing a connection to SQL Server ) 发现错误与访问数据库的权限有关。