gpt4 book ai didi

c# - Visual Studio 2013 数据库创建错误 : a network related or instance specific error occurred while establishing connection with sqlserver

转载 作者:行者123 更新时间:2023-11-30 18:28:43 25 4
gpt4 key购买 nike

首先,让我告诉你,我已经通过谷歌搜索尝试了所有该死的方法来克服这个错误,但我也没有犯过任何 TYPO 错误。但是,谷歌的结果都没有帮助。让我告诉你这个场景......我安装了 Visual Studio Ultimate 2013(没有别的,没有单独的 sqlexpress,没有)。所有非数据库应用程序都运行良好。但是,对于一个项目,当我尝试创建新的数据库连接时(通过右键单击“数据连接”或单击“连接到数据库”图标来创建 localdb),我得到了这个错误:

"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: sqlnetwork interfaces, error 26- Error locating server/Instance specified)"

然后,像往常一样,我试着用谷歌搜索它。但是大多数答案都与sqlexpress(我没有单独安装)有关。然后一个答案是关于“sqlserver 配置管理器”和启用 sqlservices 以及称为表面积的东西......但是,由于“sqlserver 配置管理器”不在我的 Windows 8 (64x) 机器上的“所有程序”中,我下载了sqlexpress 和 sqlserver management studio 也是。但是没有一个名为“表面区域管理器......”的项目。我启用了 sqlservices,所有 tcp/ip 端口。关闭我的防火墙。仍然出现相同的错误。

注意:直到现在我的 webconfig 中还没有任何连接字符串,因为我只是要创建新的数据库。所以关于编辑 conn 字符串的答案对我来说并不重要。

注意:Visual Studio 2012 不是这种情况。只有 VS2012(没有其他)安装,它可以很好地创建数据库和所有其他东西。那么,VS2013 有什么问题??

最佳答案

Server\Instance name 必须可以从您的客户端访问,因为连接字符串的创建将尝试验证它是否连接正常。从您的工作站试试这个:

sqlcmd -Sservername\Instance_or_IPaddress_of_Sql_server -E -Q"select @@version"

在获得正确的服务器名称或实例之前,您将无法成功创建数据库连接。

关于c# - Visual Studio 2013 数据库创建错误 : a network related or instance specific error occurred while establishing connection with sqlserver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24334881/

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