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

编程入门 行业动态 更新时间:2024-10-26 16:25:56
本文介绍了为什么在与 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.

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

  • 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 建立连接时会出现与网络相关或特定于实例的错误?

    本文发布于:2023-11-02 13:41:48,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1552544.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:在与   时会   实例   错误   网络

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!