Link to home
Start Free TrialLog in
Avatar of ttist25
ttist25

asked on

How to set connection timeout property in SQL Server Management Studio 2008

Hello there,

I'm having some trouble with timeout issues in my ASP.NET application.  I'm getting the following error when running a query:

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

This query used to work but I think my data set has just grown too large and it's timing out.  I tried setting my connection string to include Connection Timeout=0 but that didn't help.

When I look at the properties of the database from SQL Server Management Studio (right click the database, click Properties, and then click "View connection properties") the Connection Timeout is set to 15.  I'm not able to change this value here as it's read only from this view.  

My question is - should I be trying to change this value in SSMS to try to fix this error and, if so, how can I modify it?

I'm a real hack when it comes to this so please don't assume any knowledge.  :)

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg 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
try increasing this

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell\DataProject\SQLQueryTimeout
Avatar of ttist25
ttist25

ASKER

myCommand.CommandTimeout = 0 seems to have taken care of it.

THanks!