Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set CommandTimeout
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00830660
Message ID:
00830698
Views:
25
>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
--------------------------------
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform