Link to home
Start Free TrialLog in
Avatar of esc7
esc7

asked on

Timeout expired with SQL Server query

When running a stored procedure from my asp.net application I recieve the following error:
System.Data.SqlClient.SqlException: Timeout expired

The command object timeout property is set to the default of 30.

However when I run the same stored procedure in Query Analyzer it only take 6 seconds to complete.

What, other than the time it takes to execute the query, would cause a "timeout expired" error.
Avatar of Sammy
Sammy
Flag of Canada image

Most likely your database is locked
restart your sql service and see if that happens
that can also open if you keep opening connections without closing them in your code. always check for the connection status before you open it

HTH
Avatar of esc7
esc7

ASKER

i restarted the service but no change.
i also checked to make sure that i am opening and closing a single connection... still no change.
ASKER CERTIFIED SOLUTION
Avatar of Sammy
Sammy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
an infinite loop can also cause a timeout expired error... Maybe you can post the query here...