Home All Groups Group Topic Archive Search About
Author
13 Dec 2006 5:24 PM
Andrew Robinson
Is there any way to set the CommandTimeout within the connection string as
opposed to setting the property on the SQL Command Object which defaults to
30 seconds.

Please note that I am not talking about the connection timeout property that
is definately part of the connection string.

Thanks for any help.

Andy

Author
13 Dec 2006 6:41 PM
Gabriel Lozano-Morán
By default it will always be set to 30 secs unless changed using the
CommandTimeout property

Gariel Lozano-Morán
The .NET Aficionado
http://www.pointerx

Show quote
"Andrew Robinson" <nemoby@nospam.nospam> wrote in message
news:eDkXlutHHHA.4992@TK2MSFTNGP04.phx.gbl...
> Is there any way to set the CommandTimeout within the connection string as
> opposed to setting the property on the SQL Command Object which defaults
> to 30 seconds.
>
> Please note that I am not talking about the connection timeout property
> that is definately part of the connection string.
>
> Thanks for any help.
>
> Andy
>
Author
14 Dec 2006 7:18 AM
WenYuan Wang
Hi Andy,

First of all, I'd like to confirm my understanding of your issue.
According to your description, I understand that you want to know whether
there is a way to set the CommandTimeout within the connection string.
If I misunderstood anything here, please don't hesitate to correct me.

As far as I know, I'm afraid we can *not* set the CommandTimeout in the
connection string.
The CommandTimeout is the property of DataCommand, and the default value is
30 seconds.
The connection string is used to connect the database. It is not related to
DataCommand.
There is no option which we can use to set the timeout of DataCommand.

If you want to set the CommandTimeout property of DataCommand, I would like
to suggest you using the following statement.
SqlCommand.CommandTimeout=30;

If there is anything I can help with, please feel free to reply me here. We
will follow up.
I'm glad to work with you.
Sincerely,
Wen Yuan
Author
14 Dec 2006 2:11 PM
Marina Levit [MVP]
No, there is not. This is not a connection level property.

Show quote
"Andrew Robinson" <nemoby@nospam.nospam> wrote in message
news:eDkXlutHHHA.4992@TK2MSFTNGP04.phx.gbl...
> Is there any way to set the CommandTimeout within the connection string as
> opposed to setting the property on the SQL Command Object which defaults
> to 30 seconds.
>
> Please note that I am not talking about the connection timeout property
> that is definately part of the connection string.
>
> Thanks for any help.
>
> Andy
>
Author
18 Dec 2006 3:33 AM
WenYuan Wang
Hi Andy,

Just want to check whether there is anything we can help with.
Please feel free to reply me here, and we will follow up.
I'm glad to work with you.

Have a good day,
Best regards,
Wen Yuan

AddThis Social Bookmark Button