timout error on server running vb .net routine

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

I'm getting the following error - not always, only randomly - when I run a
certain routine (the routine is a simple executenonquery and it appears to
complete despite the message) against sql server 2000:

"timout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding"

Anyone have any idea what causes this and how to avoid it?

Thanks for any help.

Bernie Yaeger
 
Hi Bernie,

Does the rutine take a long time to complete?
Try increasing CommandTimeout value.
 
Hi Miha,

What is the default timeout? Also, how high can I set it? Also, can it be
set globally? Finally, is there any downside to setting it high?

Thanks for your help.

Bernie

Miha Markic said:
Hi Bernie,

Does the rutine take a long time to complete?
Try increasing CommandTimeout value.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Bernie Yaeger said:
I'm getting the following error - not always, only randomly - when I run a
certain routine (the routine is a simple executenonquery and it appears to
complete despite the message) against sql server 2000:

"timout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding"

Anyone have any idea what causes this and how to avoid it?

Thanks for any help.

Bernie Yaeger
 
Hi Bernie,

Bernie Yaeger said:
Hi Miha,

What is the default timeout?

The default is 30 seconds for SqlCommand.

Also, how high can I set it?

It is an int property. I guess you'll have enough :)

Also, can it be
set globally?

No, it is an instance property.

Finally, is there any downside to setting it high?

You'll have to wait more time if a deadlock or some other problem occurs.
 
Hi Miha,

Tx - you've helped me solve the problem - I'm simply setting it to 600 (10
minutes).

Thanks again,

Bernie
 
Back
Top