Is it possible to set CommandTimeout at connection level?

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
 
G

Guest

Hi,

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

Saravanan K V
 
S

Serg

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.
 
M

Marina

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.
 
C

Cor Ligthert

Serg,

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

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top