none
ArgumentNullException ,System.Data.SqlClient.SqlConnection.Open() RRS feed

  • Question

  • Event code: 3005 
    Event message: 发生了未经处理的异常。 (UnhandledException)
    Event time: 2017/11/10 8:31:59 
    Event time (UTC): 2017/11/10 0:31:59 
    Event ID: 41301518159443a0a924a53995c56eb3 
    Event sequence: 136210 
    Event occurrence: 12231 
    Event detail code: 0 
     
    Application information: 
        Application domain: /LM/W3SVC/2/ROOT-1-131547081197816320 
        Trust level: Full 
        Application Virtual Path: / 
        Application Path: C:\web\sts\ 
        Machine name: STS1 
     
    Process information: 
        Process ID: 5524 
        Process name: w3wp.exe 
        Account name: HNTEACHER\STS 
     
    Exception information: 
        Exception type: ArgumentNullException 
        Exception message: 值不能为 null。(value can not be null)
    参数名: value (argument name)
       在 System.String.EndsWith(String value, StringComparison comparisonType)
       在 System.Data.Common.ADP.IsAzureSqlServerEndpoint(String dataSource)
       在 System.Data.ProviderBase.DbConnectionPool.IsBlockingPeriodEnabled()
       在 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()
       在 Hnop.Tzh.SQLHelper.ExecuteNonQuery(CommandType commandType, String commandText, SqlParameter[] commandParameters)
       在 HnTeacher.STS.Portal.SSO.Jump.SaveJumpLog(String userId, String timeStr, String redirectUrl)
       在 HnTeacher.STS.Portal.SSO.Jump.ProcessRequest(HttpContext context)
       在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

     
     
    Request information: 
        Request URL: http://sts.hnteacher.net/SSO/Jump.ashx?url=urn://180.76.248.227/Home/HomeToGzf_Auto?ProjectID=2017C201&ClassId=56FD6647-F2B6-40E4-A5E7-54FDF5569F47 
        Request path: /SSO/Jump.ashx 
        User host address: 10.63.30.39 
        User: 770121 
        Is authenticated: True 
        Authentication Type: Forms 
        Thread account name: HNTEACHER\STS 
     
    Thread information: 
        Thread ID: 245 
        Thread account name: HNTEACHER\STS 
        Is impersonating: False 
        Stack trace:    在 System.String.EndsWith(String value, StringComparison comparisonType)
       在 System.Data.Common.ADP.IsAzureSqlServerEndpoint(String dataSource)
       在 System.Data.ProviderBase.DbConnectionPool.IsBlockingPeriodEnabled()
       在 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()
       在 Hnop.Tzh.SQLHelper.ExecuteNonQuery(CommandType commandType, String commandText, SqlParameter[] commandParameters)
       在 HnTeacher.STS.Portal.SSO.Jump.SaveJumpLog(String userId, String timeStr, String redirectUrl)
       在 HnTeacher.STS.Portal.SSO.Jump.ProcessRequest(HttpContext context)
       在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     
     
    Custom event details: 

    ----

    can you help me ?


    ...

    Friday, November 10, 2017 3:16 AM

All replies

  • Hi Chivas_Tan,

    According to your description and related error message, it seems that it is a common issue, I am not sure not what causes the issue, could you please provide a bit more information about the issue, such as related code, how can we reproduce the issue on our side. it will be beneficial to resolve the issue.

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 10, 2017 7:25 AM
    Moderator
  • Here's the stack trace when the app crashed.

    Stack trace:    在 System.String.EndsWith(String value, StringComparison comparisonType)
       在 System.Data.Common.ADP.IsAzureSqlServerEndpoint(String dataSource)

    Here's the stack trace when the app crashed. So the code crashed because the IsAzureSqlServerEndpoint had a null string reference when it called EndsWith. That is most likely because the dataSource parameter was null.

    In your code, this is the last line that is executed before going into the framework.

    Hnop.Tzh.SQLHelper.ExecuteNonQuery(CommandType commandType, String commandText, SqlParameter[] commandParameters)

    Put a breakpoint on this line and verify the connection string is valid before it is used.


    Michael Taylor http://www.michaeltaylorp3.net

    • Proposed as answer by Fei HuModerator Thursday, November 16, 2017 1:52 AM
    Friday, November 10, 2017 3:53 PM
    Moderator
  • This issue not ionvoked everytime.

    I just restart my server to resovle that issue.

    i shared my code here:链接: https://pan.baidu.com/s/1bCHZ3o 迷妈: 8yjm


    ...

    Wednesday, December 6, 2017 8:01 AM