Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you set the Command Timeout
Message
From
22/11/2004 20:17:28
Max Fillmore
Essential Skills, Inc.
Lenexa, Kansas, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
How do you set the Command Timeout
Environment versions
Environment:
VB.NET 1.1
Database:
MS SQL Server
Miscellaneous
Thread ID:
00963696
Message ID:
00963696
Views:
49
I have a very large and complex view in my SQL Server. When I try retrieve the rows from this view in my business object with Me.GetDataSet("Select * From myview") I get the error message "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

I traced the code and found that the command object is created in mmDataAccessSql.CreateCommand() of mmData.cs, which is declared like this:
public override IDbCommand CreateCommand(string cmdText, IDbConnection connection)

The command is created with a Command Timeout of 30 seconds. I need about 45 seconds to run my command. I tried increasing the Connection Timeout by adding ;Connection Timeout=60 to the connection string definition in app.config. That didn't help.

I thought about overriding CreateCommand() but the function is not declared virtual and I think I would have to override in several places.

Is there any easy way to increase the Command Timeout from 30 seconds? It seems to me that there should be a Timeout parameter on GetDataSet() which would be passed on to mmDataAccessSql.FillDataSet() where it could be applied to the SqlCommand object.

I'm sure this has been discussed before. Could some kind person please respond with the messageid? Or what do you suggest? Seems like this should be in the help file.

Thanks,
Max...
Next
Reply
Map
View

Click here to load this message in the networking platform