NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

SQLCommand.CommandTimeout

Gets or sets the wait time before terminating the attempt to connect and generating an error.

[Visual Basic]
Public Property CommandTimeout As Integer
[C#]
public int CommandTimeout {get; set;}
[C++]
public: __property int get_CommandTimeout();
public: __property void set_CommandTimeout(int);
[JScript]
public function get CommandTimeout() : int;
public function set CommandTimeout(int);

Property Value

The time (in seconds) to wait for the command to execute. The default value is 30 seconds.

Exceptions

Exception Type Condition
InvalidCommandTimeout The property is assigned a value less than 0.

Remarks

Use this property only after the connection is open.

Example

The following example creates a SQLCommand and sets some of its properties.

See Also

SQLCommand Class | SQLCommand Members | System.Data.SQL Namespace | CommandText | ActiveConnection | CommandType | CommandBehavior | DefaultCommandTimeout