【问题标题】:Do I need to install microsoft sql server or it comes as by default with visual studio community 2017?我需要安装 microsoft sql server 还是默认安装在 Visual Studio Community 2017 中?
【发布时间】:2019-04-09 13:28:10
【问题描述】:

我已经安装了 Visual Studio Community 2017。现在我想在我的应用程序中使用数据库,但是我

TITLE: Error
------------------------------

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

The system cannot find the file specified

------------------------------
BUTTONS:

OK
------------------------------

我 有人可以告诉我我做错了什么吗?

【问题讨论】:

  • 运行services.msc。您是否有任何名称中带有 SQL 的服务运行?
  • 实际上我之前安装了 microsoft sql server 2008 express 然后我卸载了它,因为当我点击启动 sql 服务时它立即启动并停止
  • 我也删除了sql server management studio
  • sql server 代理选项仍然存在,当我点击启动时它会自动停止

标签: c# asp.net sql-server database visual-studio-2017


【解决方案1】:

【讨论】:

  • 是否可以使用 Visual Studio Community 2017 附带的默认数据库?
【解决方案2】:

Visual Studio 默认不提供它。但是你得到了开箱即用的 LocalDB,它是 SQL Server Express 的兼容轻量级开发版本,并且应该在很大程度上满足你的需求。 为此您只需要在安装过程中勾选某些复选框,您的 Visual Studio 安装也可以稍后进行修改,请在此处查看这篇非常有用的帖子:

How to install LocalDB 2016 along with Visual Studio 2017?

【讨论】:

  • 试试这个:在 Visual Studio 中打开菜单View,然后选择SQL Server Object Explorer。如果你做的一切都正确,那么应该有一个节点(可能在顶部)读取SQL Server,展开并检查是否有一个名为(localdb)\MSSQLLocalDB的子节点
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-12-04
  • 1970-01-01
  • 2015-10-15
  • 1970-01-01
  • 1970-01-01
  • 2012-01-15
  • 1970-01-01
相关资源
最近更新 更多