System.Data.SqlClient.SqlException (0x80131904): 建立連接至 SQL Server 時,發生網路相關或執行個體特定的錯誤。找不到或無法存取伺服器。確認執行個名稱是否正確,以及 SQL Server 是否設定為允許遠端連線。 (provider: Named Pipes Provider, error: 40 - 無法開啟至 SQL Server 的連接) ---> System.ComponentModel.Win32Exception (0x80004005): 系統找不到指定的檔案。 於 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager) 於 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) 於 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) 於 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) 於 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) 於 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) 於 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) 於 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) 於 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) 於 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) 於 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) 於 System.Data.SqlClient.SqlConnection.Open() 於 Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() 於 Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand command) 於 MaxFrame2005.Base.ExecuteSqlServerDAL.ExecuteSQLString(String cmdText) 於 C:\Inetpub\wwwroot\TCFP\TCFP.Services\ExecuteSqlServerDAL.cs: 行 123 ClientConnectionId:00000000-0000-0000-0000-000000000000 Error Number:2,State:0,Class:20

 


執行階段錯誤

'/2013' 應用程式中發生伺服器錯誤。

執行階段錯誤

描述: 伺服器上發生應用程式錯誤。此應用程式的目前自訂錯誤設定因安全性考量,防止他人從遠端看見應用程式錯誤的詳細資訊。然而,可以使用本機伺服器電腦上的瀏覽器檢視。

詳細資料: 若要在遠端電腦檢視此特定錯誤訊息的詳細資訊,請於目前 Web 應用程式根目錄內的 "web.config" 組態檔中建立 <customErrors> 標記。然後將 <customErrors> 標記的 "mode" 屬性設為 "Off"。


<!-- Web.Config 組態檔 -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

注意: 可以藉由修改應用程式 <customErrors> 組態標記的 "defaultRedirect" 屬性,使其指向自訂錯誤頁面的 URL,以便使用自訂錯誤頁面取代您目前看到的錯誤頁面。


<!-- Web.Config 組態檔 -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>