Hi Experts,

I have a windows service running every minute and has many database operations to perform.
It runs perfectly for many days, sometimes it suddenly stops and throws this exception. Later when we start to debug it, the exceptions goes off, but if we don't debug, the exception continues to come. We are tired of this totally random scenario. Please assist us with this.

We are using sqlhelper.cs for database interaction.

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

Best Regards,
Wajid Ahmed Ansari.

It's exactly as it says. The operation you are trying to perform is taking longer than the specified time-out. You should look at where the exception occurs, what operation is being performed and the data it is working with.

Also check that the database service is up and running and you can connect to it and perform queries on it.

It's exactly as it says. The operation you are trying to perform is taking longer than the specified time-out. You should look at where the exception occurs, what operation is being performed and the data it is working with.

Also check that the database service is up and running and you can connect to it and perform queries on it.

Already did that, database is up and running perfectly.

It seems a DB problem, but i connected through Sql Management studio and iam able to do everything through it (Like querying,updating etc...), just through code is the problem.

The service is calling DB very frequently. Since three hours the service is responding well and no sign of DB overloads. Also it had been on for 20 days without rest and everything was well.

I will post the message if i get this exception again, i already cleared my logs before.

The additional insight into the problem is every method going to DB suffers the same exception. Like simple update statement running within a second now takes more than 30 seconds when this problem comes up.

So i got curious as whats the main issue.

Hope this helps to get hold of problem.

Did you try the bit I wrote above it?

It seems a DB problem, but i connected through Sql Management studio and iam able to do everything through it (Like querying,updating etc...), just through code is the problem.

The service is calling DB very frequently. Since three hours the service is responding well and no sign of DB overloads. Also it had been on for 20 days without rest and everything was well.

I will post the message if i get this exception again, i already cleared my logs before.

The additional insight into the problem is every method going to DB suffers the same exception. Like simple update statement running within a second now takes more than 30 seconds when this problem comes up.

So i got curious as whats the main issue.

Hope this helps to get hold of problem.

This article has been dead for over six months. Start a new discussion instead.