473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

timout error on server running vb .net routine

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
Nov 20 '05 #1
2 1516
Bernie:

There are two timeouts in SQL Server that you want to think about.
Connection Timeouts and Command Timeouts. Connection Timeouts occur when
you try to open a connection but are unable to for longer than the default
period of time. You can only adjust this in the connectionstring b/c the
TimeOut property is read-only...hence, once you create your connection
string, this can't be changed. Now, once you have a connection, theh
Command object has a timeout too. So, if you set the Command.TimeOut to 30
seconds and the query took 35 seconds, you'd get an exception. This is
easier to deal with b/c you can just bump it up.

The big problem though is why it's taking so long to execute. Most inserts
should take a fraction of a second for one record so I'd probably look to
Sql Profiler and see what's happening. Unfortunately, htere's not just one
thing that causes Command Timeouts, there are tons of things it could be.
Connection timeouts are a little easier to deal with b/c it's usually that
the server is down, no connections are available, your network cable is
loose, stuff like that.

Does it happen predictably? If so, that may help isolate it. Also, is it a
test server or a production server? If it's a production server, look to
see what's happening in the background (reindexing for instance or
updatestats may cause a temp lock on the db and may be causing this.

If you can, run a trace and see if that doesn't tip you off.

HTH,

Bill
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:uR**************@TK2MSFTNGP09.phx.gbl...
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

Nov 20 '05 #2
Hi Bill,

Thanks for your response. The issue was this: before undertaking important
routines I copy a 750,000 table to a bu table - this runs in a stored proc
that I call via executenonquery. I solved the problem by simply changing
the commandtimeout property to 600 (10 minutes).

Tx for your help, as always.

Bernie

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:er**************@TK2MSFTNGP10.phx.gbl...
Bernie:

There are two timeouts in SQL Server that you want to think about.
Connection Timeouts and Command Timeouts. Connection Timeouts occur when
you try to open a connection but are unable to for longer than the default
period of time. You can only adjust this in the connectionstring b/c the
TimeOut property is read-only...hence, once you create your connection
string, this can't be changed. Now, once you have a connection, theh
Command object has a timeout too. So, if you set the Command.TimeOut to 30 seconds and the query took 35 seconds, you'd get an exception. This is
easier to deal with b/c you can just bump it up.

The big problem though is why it's taking so long to execute. Most inserts should take a fraction of a second for one record so I'd probably look to
Sql Profiler and see what's happening. Unfortunately, htere's not just one thing that causes Command Timeouts, there are tons of things it could be.
Connection timeouts are a little easier to deal with b/c it's usually that
the server is down, no connections are available, your network cable is
loose, stuff like that.

Does it happen predictably? If so, that may help isolate it. Also, is it a test server or a production server? If it's a production server, look to
see what's happening in the background (reindexing for instance or
updatestats may cause a temp lock on the db and may be causing this.

If you can, run a trace and see if that doesn't tip you off.

HTH,

Bill
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:uR**************@TK2MSFTNGP09.phx.gbl...
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


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RonHiler | last post by:
Hi guys, I run a game server (for a game I'm writing in development). I had a routine on my web site which detected if the server was up or down and displayed a icon, so that people could see...
2
by: Dean g | last post by:
hi, i'm trying to upload some large files off my website to the server. It works fine for small files but the large ones timeout. i changed the timeout to 3600 secs using server.scripttimeout=60*60...
2
by: Matt | last post by:
I am having trouble with the HttpWebRequest.GetRequestStream method. I am posting data to my web server running NT4 iis4 using a loop. So every time the loop executes I want it to post data to...
0
by: Agnes | last post by:
the application run in my office is very well. However, as it move to the client's company, Timeout and general network error always happend. We found that the firewall had a default setting "if it...
2
by: tshad | last post by:
This has been driving me crazy. I have been trying to get the error handling working on my system and can get parts of it working and others won't work at all. I found that you can't access...
8
by: Brian Tkatch | last post by:
Server: DB2/SUN 8.1.6 Client: DB2 Connect Personal Edition (No 11) <URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe> ...
2
by: Andy | last post by:
Hi there, I have an asp.net 2 web application with SQL Server 2005 db, running on IIS6. I have implemented some error trapping in the global.asax file, along the lines of: void...
7
by: =?Utf-8?B?SmFzb24=?= | last post by:
Hello, can someone please suggest to me how I can keep my ftp connection from timing out after a large file download? I am using SSIS and I have tried multiple ways of ftp'ing the files in my...
0
by: rjr1328 | last post by:
After laboring forever on ASNCLP connection scripts, build all the pieces of a replication process, I find that I am stuck on what seems to be a simple error. I am to replicate from one Redhat...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.