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:
00928305
Vues:
65
Kevin,

Thanks, increasing the command timeout solved the problem.

Kind Regards,

Mat

>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,
Matthew Kennedy
Decision Support Technology Inc.

"I try to take one day at a time, but sometimes several days attack me all at once." ~ Ashleigh Brilliant

New Jersey Dot Net User Group
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform