Command timeout property in VB

5.1k views Asked by At

How can I override the default Command time out Property(30 seconds) to 600 seconds in VB?

I know we need to change the command time out in SQLhelper.vb I have a code where i can see sqlcommand mentioned in the Private class.

where I need to mention the below command whether it should be in sqlcommand private class or it should be in SQLconnection sting public class.

command.CommandTimeout = 600
1

There are 1 answers

2
IronAces On

Where ever you are using your SqlCommand, you can override the default timeout of 30 seconds, as below

command.CommandTimeout = 600

However, the CommandTimeout property will be ignored during asynchronous method calls such as BeginExecuteReader.

This is all documented Here.