gpt4 book ai didi

.net - 为什么在建立与 SQL Server 的连接时会发生与网络相关或特定于实例的错误?

转载 作者:行者123 更新时间:2023-12-03 05:51:46 24 4
gpt4 key购买 nike

我很沮丧。我有一个使用本地数据库在 Visual Web Developer 2008 Express 上运行的网站,一切都运行良好。我还在生产服务器上运行相同的网站。一切都很顺利,但今晚我对生产进行了“重置”。

  1. 我删除了几个表,重新创建它们并插入数据。此时一切正常。

  2. 我通过 FTP 删除了所有文件。

  3. 我使用了 Visual Studio 中名为“复制网站”的模块,通过 FTP 将网站复制到网站。

当我登录我的网站时,出现以下错误:

Server Error in '/' Application.

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: 26 - Error Locating Server/Instance Specified)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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: 26 - Error Locating Server/Instance Specified)

<小时/>

与 SQL 连接相关的任何内容都没有改变,这是我一直使用的旧代码。我的网站因此完全瘫痪,我心里很难受,因为我觉得我无能为力。

有人可以帮我吗?

最佳答案

当您在服务器上复制新的网站版本时,您的连接字符串可能已被覆盖。请检查 web.config 中的连接字符串是否有效。

关于.net - 为什么在建立与 SQL Server 的连接时会发生与网络相关或特定于实例的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1391503/

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