0

I have a piece of code that executes stored procedure.i have given a "Waitfor Delay '00:05' " in the SP for the purpose of testing the timeout in my C# code wherein my commandtimeout is set for 10 mins. While debugging, after 20 seconds or so when the executereader for the SP is executed,I am getting a timeout . Stuck on this for 2 days, any help is much appreciated.

Riya
  • 1

1 Answers1

0

Give ConnectionTimeout as 0, it means undefined waiting time.And one more thing , u can debug the SP using EXEC command in sql server itself and check where the time taking in code or in SP.

Connection Timout in code

SqlDataAdapter da = new SqlDataAdapter(Query, ConnectionString);
da.SelectCommand.CommandTimeout = 0;

Execute SP in sql server

EXEC procedure_name; 

Regards Aravind

Aravind Aravind
  • 179
  • 1
  • 10
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 18 '22 at 13:32