-3

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
IronAces
  • 1,857
  • 1
  • 27
  • 36
Rupa
  • 1
  • 1
  • 2

1 Answers1

2

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.

IronAces
  • 1,857
  • 1
  • 27
  • 36
  • Hello Daniel, Thanks for your answer. An unhandled exception has been raised in the Monitor.UI System and email could not be issued to developers. please report the error. Email Error:Format of the initialization sting does not confirm to specification starting at index 0. we are getting above error when users are trying to connect the application.we need to fix this issue so we thought to extend the command time out property. – Rupa Jun 20 '18 at 15:15
  • That doesn't sound like a timeout issue @Rupa – IronAces Jun 20 '18 at 15:41