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);
The time (in seconds) to wait for a connection to open. The default value is 15 seconds.
Exception Type | Condition |
---|---|
BrokenConError | The connection is broken. |
InvalidConnectionTimeout | The property is set to a value less than 0. |
This property overwrites the matching property in the connection string.
Note This property is read-only while the connection is open.
The following example creates a SQLConnection and sets some of its properties.
SQLConnection Class | SQLConnection Members | System.Data.SQL Namespace | ConnectionString | Database | DataSource | UserID | Password | IsolationLevel