Is it possible to set CommandTimeout at connection level?

  • Thread starter Thread starter Serg
  • Start date Start date
S

Serg

Our app uses third party component and we do not have source code.
That component requires as parameter Connection object only and we do not
have access to the Command object it creates inside. So if query it
generates exceeds 30 seconds timeout exception occurs.

Is it possible to set CommandTimeout at connection level? May be there is
undocumented ConnectionString options?
I can`t find it in MSDN.
Please help
Thanks in adv
Serg
 
Hi,

For SqlConnection, you can specify "Connection Timeout=n" in the connection
string

Saravanan K V
 
Thanks for fast reply.
But this is not the solution.
ConnectionTimeout does not the same as CommandTimeout.
ConnectionTimeout affects only at Connection stage when client searches net
for SqlServer.
If i set ConnectionTimeout it does not affect on CommandTimeout. It remains
default 30 sec.
 
No, you cannot.

You should talk to the 3rd party regarding giving you a way to specify the
command timeout. Like adding a paramter to their method to let you control
that.
 
Serg,

Than you have in my opinion a problem for what only your vendor of the 3th
party commandcontrol can help you with.

Cor
 
Back
Top