Control time to return timeout

Asked

Viewed 198 times

1

Look at the scenery:

I have a procedure that running directly by SQL it takes about 50s to return the data. However, when this same process is executed via the system, the timeout in 15 s.

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

1 answer

1


Do so:

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

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

Source: here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.