Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you set the Command Timeout
Message
De
22/11/2004 20:17:28
Max Fillmore
Essential Skills, Inc.
Lenexa, Kansas, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
How do you set the Command Timeout
Versions des environnements
Environment:
VB.NET 1.1
Database:
MS SQL Server
Divers
Thread ID:
00963696
Message ID:
00963696
Vues:
50
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...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform