Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SqlCommand.CommandTimeout
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00924349
Message ID:
00925874
Vues:
27
Mat,

>Thank you for the reply, but I don't think this is the problem I am encountering. I had tried changing this in my app.config file, but it did not help. I could be wrong, but I don't think this setting applies to the individual queries. It looks like SqlCommand.CommandTimeout is the property I need to change, I am just not sure how.

You're right in that there is both a Connection timeout and a Command timeout. Sounds like your issue is with the default 30 second Command timeout.

MM .NET data access classes use the default Command timeout. If you want to change this, then you can create a subclass of the mmDataAccessSql class and override the CreateCommand method. For example:
public override IDbCommand CreateCommand(string cmdText)
{
	// Call the base class method
	SqlCommand cmd = base.CreateCommand(string cmdText);
	// Set the Command Timeout
	cmd.CommandTimeout = 60;   // Can set to zero for "no timeout"
	
	return cmd;
}
Now in your company or project-level business object (e.g. ABusinessObject) override the CreateDataAccessObject() method to return your custom data access class.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform