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

查看:102
本文介绍了建立与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连接无关的任何更改,这是我一直使用的OLD代码。
因为这个原因,我的网站完全瘫痪了,内心感到恶心,因为我觉得我无能为力。


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天全站免登陆