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

Why did a network-related or instance-specific error occur while establishing a connection to SQL Server?(为什么在建立与 SQL Server 的连接时会发生与网络相关或特定于实例的错误?)
本文介绍了为什么在建立与 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 的连接时会发生与网络相关或特定于实例的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)