asp.net.ph

IDbConnection.ConnectionTimeout Property

System.Data Namespace   IDbConnection Class


Returns the time to wait while trying to establish a connection before terminating the attempt and generating an error.

Syntax


Script [ integer variable = ] IDbConnection.ConnectionTimeout

Property Value


variable Returns the time ( in seconds ) to wait for a connection to open.

The property is read only with a default value of 15 seconds.

NOTE: You can change the value for this property only by setting the associated keyword in the ConnectionString property.

Exceptions


Exception Type Condition
ArgumentException Occurs when the value set is less than 0.

Remarks

A value of 0 indicates no limit to the wait time, rather than no wait time, and should be avoided in a ConnectionString because an attempt to connect will wait indefinitely.

Example

The following example shows the simplest way to retrieve and display the ConnectionTimeout property of the current connection.

"Time Out: " + myConn.ConnectionTimeout.ToString ( );
  C# VB

 Show me 

See Also

IDbConnection Members   ConnectionString   Database Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph