|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CommandTimeoutIs 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 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 > 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 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 > |
|||||||||||||||||||||||