timout error on server running vb .net routine

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
 
M

Miha Markic [MVP C#]

Hi Bernie,

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

Bernie Yaeger

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
 
M

Miha Markic [MVP C#]

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.
 
B

Bernie Yaeger

Hi Miha,

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

Thanks again,

Bernie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top