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.
Asked
Active
Viewed 434 times
0
-
add your code in question so will check, where is set `CommandTimeout` in your code. β Piyush Kachhadiya May 18 '22 at 05:51
-
Is it a connection timeout or a command timeout? Please show code β Charlieface May 18 '22 at 08:58
1 Answers
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