Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
How to set CommandTimeout
I'm trying to create a Windows Forms interface to launch end of month queries, each of which requires several minutes to generate results. I have a stored procedure (query) that requires app. 2-3 minutes running time in SQL Server. It runs fine in Query Manager, but when I run it directly from a C# app. in app. 30 seconds I get the error message: The timeout period elapsed prior to completion of the operation or the server is not responding. If I add additional filters to reduce query time, it works fine.
I set the timeout in the connection string in app.config to 0 (just for testing purposes).
I reference the data access object via
OakLeaf.MM.Main.Data.mmDataAccessBase dao =
this.GetDataAccessObject("Recovery")
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement