Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding [closed]

三世轮回 提交于 2019-12-20 07:46:25

问题


hi I'm getting an error Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
I'm alredy changed the connect timeout = 60000 and in database my procedure is executes in 43sec. so plz give me some perfect solution

thank you


回答1:


You should note that Timeout property for SqlConnection object and Timeout property for SqlCommand object are different properties.
By default command timeout is set to 30 seconds. Set it to 60, and your issue will be solved:

commandObject.Timeout = 60;

But most likely that you should change your SQL procedure or split it to some parts




回答2:


Try running your SQL query using Microsoft SQL Server Management Studio, and click the "Estimated Execution Plan" button. This will tell you if you have any indexes missing. Adding the missing indexes should speed up your query.




回答3:


Increase the query timeout. Connection timeout is only on the connection time. Presuming you are using SqlCommand, there is a timeout property in there.



来源:https://stackoverflow.com/questions/6743320/timeout-expired-the-timeout-period-elapsed-prior-to-completion-of-the-operation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!