none
SP 2016 Provider Hosted Apps - SQL Timeout RRS feed

  • Question

  • i have SP 2016 Provider Hosted app that talks to DB to push/pull data.

    The report view screen of the app pulls data from DB via SQL procedure and when the data is YTD, it throws timeout on app. 

    when the data is for 2-3 quarters, there is no issue. 

    Pls help.

    [Win32Exception (0x80004005): The wait operation timed out]

    [SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +3306108
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +736
       System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4061
       System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +90
       System.Data.SqlClient.SqlDataReader.get_MetaData() +99
       System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) +604
       System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +3303
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +667
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +83
       System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +301
       System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +201
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +178
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +122
       xxx.xxxx.xxxx.SQLHelper.ExecuteStoredProcAsDataTable(String procName, List`1 dataParams) +293

    • Edited by GauDodd Tuesday, October 15, 2019 8:33 AM
    Tuesday, October 15, 2019 8:26 AM

All replies

  • Hi,

    How long it would take to execute the procedure?

    If the procedure takes too much time, I would suggest you optimize the stored procedure.

    You could try to increase the timeout also.

    https://www.techcartnow.com/increase-timeout-asp-net-application/

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, October 16, 2019 3:02 AM