为什么在建立与 SQL Server 的连接时会发生与网络相关或特定于实例的错误? [英] Why did a network-related or instance-specific error occur while establishing a connection to SQL Server?

查看:29
本文介绍了为什么在建立与 SQL Server 的连接时会发生与网络相关或特定于实例的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很沮丧.我有一个使用本地数据库在 Visual Web Developer 2008 Express 上运行的网站,一切正常.我也在生产服务器上运行相同的网站.一切都很好,但今晚我做了一个重置".在生产中.

I'm very frustrated. I have a website running on Visual Web Developer 2008 Express with my local database, everything works great. I also have the same web site running on a production server. Everything was working great but tonight I did a "reset" on production.

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

  1. I deleted a couple of table, re-created them and inserted data. Everything was ok at this time.

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

I deleted ALL the files via the FTP.

我使用了名为复制网站"的模块.在 Visual Studio 中并通过 FTP 将网站复制到网站.

I used the module called "Copy website" in visual studio and copy the site to the website via FTP.

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

When I log on my website, here is the error I got:

/"应用程序中的服务器错误.

Server Error in '/' Application.

与 SQL Server 建立连接时出现与网络相关或特定于实例的错误.服务器未找到或无法访问.验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接.(提供者:SQL 网络接口,错误:26 - 错误定位服务器/指定实例)

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)

说明:在执行当前 Web 请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.

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.

异常详细信息:System.Data.SqlClient.SqlException:建立与 SQL Server 的连接时发生与网络相关或特定于实例的错误.服务器未找到或无法访问.验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接.(提供者:SQL 网络接口,错误:26 - 错误定位服务器/指定实例)

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 连接相关的一切都没有改变,这是我一直使用的旧代码.我的网站因此完全瘫痪,我内心感到恶心,因为我觉得我无能为力.


Nothing has changed related to SQL connection, this is OLD code that I always used. My website is completely paralysed because of this and I feel sick inside because I feel there is nothing I can do.

谁能帮帮我?

推荐答案

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

Your connection string was probably overriden when you copied your new website version on the server. Please check the connection string in web.config and see if it is valid.

这篇关于为什么在建立与 SQL Server 的连接时会发生与网络相关或特定于实例的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆