Time out (Sleep)

I have a data adapter that times out while executing a Stored Procedure. How can I have the web application wait on the results to be returned I have pasted some of the code below.

DataSet dsBPMActivityReport = new DataSet();

//Open Connection

cnSandbox.Open();

//Execute Query and bind Dataview

adpBPMActivityReport.Fill(dsBPMActivityReport, "BPMActivityReport");

this.GridView1.DataSource = dsBPMActivityReport;

GridView1.DataBind();



Answer this question

Time out (Sleep)

  • Joe Farah

    You should set adpBPMActivityReport.SelectCommand.CommandTimeout properly (give it enought time to execute).

  • orokulus

    Why is not waiting for results to be returned now Unless you're doing this in a thread, it certainly should.



  • salm

    ASP.NET has a default of 90 seconds of timeout, if the query takes longer than that an HTP time out error will appear.

    In order to change the default you can change the

    <httpRuntime
    executionTimeout="90"
    maxRequestLength="4096"
    useFullyQualifiedRedirectUrl="false"
    minFreeThreads="8"
    minLocalRequestFreeThreads="4"
    appRequestQueueLimit="100"
    enableVersionHeader="true"
    />

    in the machine.config (E:\WINDOWS\Microsoft.NET\Framework\vxxxxxxxx\CONFIG)



  • xappie

    I don't think I am doing this in a thread, I have not worked with them yet. Therefore, I don't know why it is timing out before the results are returned.
  • GENOOO

    do you have a unit test to see how long the execution is

    You need to check whether it's the stored procedure timing out or the page execution.

    If it's the stored procedure, you can increase the commandtimeout property on the database connection.

    On the other hand, if this report creation really takes a long time, you may want to consider doing this on a seperate thread and signal the user to check the result later.


  • Time out (Sleep)