Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set CommandTimeout
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00830660
Message ID:
00830698
Vues:
26
>At that point I can see ConnectionTimeout = 0 under Connection in the dao tree in the watch window. So, it appears that the connection string has set it properly. Is there something else I need to do to in order to set the CommandTimeout? If so, please provide some code because I can't seem to get past this point.


ConnectionTimeout tell ADO.NET how long it should wait to get a connection, it's not what you need. You need to look at SQLCommand.CommandTimeout.

Try this:
IDbCommand c;
IDbConnection conn = this.GetDataAccessObject().CreateConnection();
conn.Open();
c = conn.CreateCommand();
c.CommandTimeout = 120;
c.CommandText = "EXEC sp_YourStoreProc";
c.ExecuteNonQuery();
Stephen Lee

--------------------------------
Too much to code
Too little time
--------------------------------
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform