Click here to Skip to main content
15,905,875 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi All,

I am trying to update the database from the solution and I have set the time out value to 180. But it keeps on giving the below issue

C#
Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.


However when I run the same thing in SQL SERVER 2008 R2 Sql query it completes in 24 seconds.



I tried setting timeout to "0", 180 and even 7200 also
I verified all the connections open are closed


Any suggestions on the issue?
Posted
Updated 8-Jul-15 4:39am
v2
Comments
Abhipal Singh 7-Jul-15 14:35pm    
Where are you setting the timeout?
What is the unit of timeout (seconds, milliseconds, etc)?
Can you publish the code to explain the problem a bit more clearly.
PIEBALDconsult 7-Jul-15 14:41pm    
Showing the code might help. (Use Improve question.)
ZurdoDev 7-Jul-15 14:56pm    
There is only one way I've seen to get a timeout issue. It's timing out.
Suvendu Shekhar Giri 7-Jul-15 15:31pm    
Try setting CommandTimeout=0
Herman<T>.Instance 8-Jul-15 10:58am    
Did you debug your code?
Do you run Express Profiler to see what is happening in your database?

1 solution

add option(recompile) after some of your select queries, let me know if that helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900