ConnectionContext.CommandTimeout Property
Gets the time (in seconds) that elapses before the command that executes the batch statement times out.
Namespace: Microsoft.VisualStudio.TeamSystem.Data.UnitTesting
Assembly: Microsoft.VisualStudio.TeamSystem.Data.UnitTesting (in Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.dll)
Syntax
'Declaration
Public Property CommandTimeout As Integer
'Usage
Dim instance As ConnectionContext
Dim value As Integer
value = instance.CommandTimeout
instance.CommandTimeout = value
public int CommandTimeout { get; set; }
public:
property int CommandTimeout {
int get ();
void set (int value);
}
public function get CommandTimeout () : int
public function set CommandTimeout (value : int)
Property Value
Type: System.Int32
Exceptions
Exception | Condition |
---|---|
ArgumentException | The value used to set CommandTimeout is less than zero (0). |
Remarks
Use this property to configure the DbCommand that is used to execute the Transact-SQL (T-SQL) statement or statements. The default value is 30 seconds.
If you want to debug into the stored procedure that is being invoked, increase the.CommandTimeout to prevent the debugging session from causing your test to fail. When Team Edition for Database Professionals creates an instance of this class, it populates this property from the settings for the app.config file in the test project.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualStudio.TeamSystem.Data.UnitTesting Namespace