如何设置SQL Server 2008 R2远程事务超时 [英] How to set SQL Server 2008 R2 remote transaction time out
本文介绍了如何设置SQL Server 2008 R2远程事务超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我编写了一个存储过程,它是从应用程序的c#窗口执行的。我使用实体数据模型连接到服务器。
问题是我的存储过程需要4分钟以上才能执行并完成其过程
但是每当我执行它时都会给出错误
I have written a stored procedure which is executing from a c# windows from application. I am connecting to the server using an entity data model.
The problem is my stored procedure takes more than 4 minutes to execute and complete its process
BUT whenever I am executing it gives error
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
我搜索这是因为远程事务超时,因为我正在从我的c#代码执行它因为当我从服务器执行它总是完成没有错误
PLS帮助我..
As I searched this is due to remote transaction time out because I am executing it from my c# code because when i am executing it from server it always complete with no error
PLS HELP ME..
推荐答案
你应该在c#代码的连接字符串中设置Connect Timeout。要了解有关连接字符串的更多信息:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(v = vs.110)的.aspx [ ^ ]
You should set you Connect Timeout in the connection string of c# code. To know more about connection string :
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx[^]
这篇关于如何设置SQL Server 2008 R2远程事务超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文