开发者

Increase Sql timeout in .net

开发者 https://www.devze.com 2023-01-21 12:09 出处:网络
I am gettting SQL time out error in my .net service. As the service is already installed on the production, is there any way I can increase the timeout for the service from App.Config file.

I am gettting SQL time out error in my .net service.

As the service is already installed on the production, is there any way I can increase the timeout for the service from App.Config file.

At present, I am getting this exception af开发者_如何学Goter one minute, I have to make it to around 10 hours because the stored procedure we are using takes 2-2 hours to execute.


You could try setting the CommandTimeout property on your SqlCommand. I hope you are not doing this in an ASP.NET application.


You can set the timeout in your connection string with "connect Timeout = 100000000;" or whatever you want your timeout to be


The time out setting is up to database server.

In SQL Server Manager open the SQL Server Properties and pick the connection tab and set time out as big as You need.

Ps.

zero goes for no timeout.

0

精彩评论

暂无评论...
验证码 换一张
取 消