Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase Sql timeout in .net

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 after one minute, I have to make it to around 10 hours because the stored procedure we are using takes 2-2 hours to execute.

like image 880
Zerotoinfinity Avatar asked Oct 21 '10 08:10

Zerotoinfinity


2 Answers

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

like image 98
Darin Dimitrov Avatar answered Sep 19 '22 18:09

Darin Dimitrov


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

like image 27
Statler Avatar answered Sep 19 '22 18:09

Statler