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!

SQLConnection.ConnectionTimeout

Gets or sets the time to wait while establishing a connection before terminating the attempt and generating an error.

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

Property Value

The time (in seconds) to wait for a connection to open. The default value is 15 seconds.

Exceptions

Exception Type Condition
BrokenConError The connection is broken.
InvalidConnectionTimeout The property is set to a value less than 0.

Remarks

This property overwrites the matching property in the connection string.

Note   This property is read-only while the connection is open.

Example

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

See Also

SQLConnection Class | SQLConnection Members | System.Data.SQL Namespace | ConnectionString | Database | DataSource | UserID | Password | IsolationLevel