Getting and Setting SQL Timeout?

核能气质少年 提交于 2020-01-04 14:11:31

问题


When running a linq query, I get the following error:

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

I'm curious to know how I can view and modify this value to see if this just needs to be bigger or if there's something wrong with my query. My query has worked in the past, so I would like to think some timeout setting was changed since it was last working.

Thanks.


回答1:


If you're using a Linq2Sql DataContext, it's available at YourDataContext.CommandTimeout.

For a SqlConnection, the CommandTimeout is a property of the SqlCommand object.



来源:https://stackoverflow.com/questions/5795566/getting-and-setting-sql-timeout

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