Home All Groups Group Topic Archive Search About

Change default timeout

Author
9 Aug 2006 6:24 PM
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

Author
9 Aug 2006 6:34 PM
Marina Levit [MVP]
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.

Show quoteHide quote
"Bawa" <jfn***@gmail.com> wrote in message
news:1155147897.722120.217570@m73g2000cwd.googlegroups.com...
> 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
>