【问题标题】:SqlExcepction 0x80131904 in ASP.net. Website can't connect to SQL Server, error 40ASP.net 中的 SqlException 0x80131904。网站无法连接到 SQL Server,错误 40
【发布时间】:2015-09-25 23:36:09
【问题描述】:

所以我今天在我公司的 ASP.net 网站(建立在旧的 DotNetNuke 框架上)出现错误,上面写着:

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

这列出了这个堆栈:

[SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +428
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.DiscoverSpParameterSet(SqlConnection connection, String spName, Boolean includeReturnValueParameter, Object[] parameterValues) +233
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSetInternal(SqlConnection connection, String spName, Boolean includeReturnValueParameter) +343
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName, Boolean includeReturnValueParameter) +175
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName) +45
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, String spName, Object[] parameterValues) +207
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.Data.SqlDataProvider.GetLogTypeConfigInfo() +71
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfo() +101
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfoByKey(String LogTypeKey, String LogTypePortalID) +65
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.AddLog(LogInfo objLogInfo) +75
DotNetNuke.Services.Log.EventLog.LogController.AddLog(LogInfo objLogInfo) +175

我最近不得不关闭该站点,我只是将文件移动到硬盘驱动器的另一部分。当我把它们搬回来时,我得到了这个。它正在连接回我们拥有的单独服务器,但连接中的某处有一个块。两台机器都能够相互ping通,所以我猜这是服务器级别的东西?堆栈对我来说非常模糊,所以我不知道在哪里寻找我的错误。想法?

【问题讨论】:

  • 1.您是否能够使用 sql server management studio 或使用应用程序服务器中的 odbcad32.exe 连接到数据库? 2.确保在有sql server的机器上——sql server agent服务正在运行
  • 尝试让sql server配置服务停止启动。

标签: asp.net sql-server iis network-programming dotnetnuke


【解决方案1】:

我将首先执行以下操作。

转到http://ServerName/install/install.aspx

查看 DNN 是否为您提供有关连接错误的任何其他详细信息。

检查 web.config 连接字符串。您是否将 IIS 设置为使用动态帐户作为应用程序池的所有者? web.config 连接字符串中的登录信息是否仍然有效?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-25
    • 1970-01-01
    相关资源
    最近更新 更多