Change default timeout

  • Thread starter Thread starter Bawa
  • Start date Start date
B

Bawa

Hi everyone,

Here's my problem. I have a big vb.net application with a lot of calls

to stored procs. I don't want to add the line "Command.commandTimeout
= 600" in front of each of these calls. So, the default timeout is set

to 30 seconds. I'm pratically sure that I canc change this 30 seconds
in a registry or in a file somewhere. I hope that Microsoft didn't
hard coded it in the class! My question: How can I change the default

command timeout in one shot for all my application.


Thanks a lot!


Bawa
 
The right way to go about doing this is to have a GetSqlCommand method (or
whatever command type you are using). This method would instantiate the
object, set the CommandTimeout property, and return it.

This would be the proper way to structure your application. Then, if you
ever need to set some other property on all your command objects, you would
do it in this method.

I don't know of any setting for something like this on a machine, and I
don't think it's necessary. Different applications would require different
timeouts, and a global setting like this wouldn't work well.
 
Back
Top