解决 System.Runtime.InteropServices.COMException (0x80070006): 句柄无效 错误

  

1. Type : System.Runtime.InteropServices.COMException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

    Message : The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
    Source : mscorlib

    Help link :

    ErrorCode : -2147024890

    Data : System.Collections.ListDictionaryInternal

    TargetSite : Void ThrowExceptionForHRInternal(Int32, IntPtr)

    Stack Trace :    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)

       at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)

       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)

       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory     connectionFactory)

       at System.Data.SqlClient.SqlConnection.Open()

       at Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection()

       at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand command)


    2. Type : System.UnauthorizedAccessException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

    Message : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

    3. Type : System.Threading.SemaphoreFullException, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

    Message : Adding the given count to the semaphore would cause it to exceed its maximum count.

解决办法

 

posted @ 2017-08-07 21:22  坚心  阅读(10112)  评论(0)    收藏  举报