Control time to return the timeout

1

See the scenario:

I have a procedure that running right through SQL takes about 50 seconds to return the data. However, when this same procedure is executed via the system, from timeout in 15s.

My question is, would it be possible to limit the time between the connection to the bank, the execution of procedure and its return, so if it is to really give timeout, only just after the parameterized time and / or wait for the procedure return the data?

    
asked by anonymous 20.06.2018 / 19:09

1 answer

1

Do this:

using (var c = SqlConnection(connstring))
{
    c.Open();
    var p = new DynamicParameters();

    c.Execute("minhaprocdanada", p, commandTimeout: 60 /*segundos*/, 
        commandType: CommandType.StoredProcedure);
}

Source: here

    
20.06.2018 / 19:15