LockTimeout Property

Syntax:

public int LockTimeout { get; set; }

Description:

Type: System.Int32

Gets or sets the lock timeout information for the connection string. The lock timeout controls how the database engine handles locks that are not immediately grantable. By default it will wait a specified number of seconds and if the locks are still unavailable will then return an error. The LockTimeout controls the length of this timeout period. A value of zero will cause the lock request to return immediately. A value of -1 will cause the lock request to wait forever. The default lock timeout, if none is specified, is 10 seconds.

Exceptions:

Exception Condition
ArgumentException The value specified is not valid (i.e. less than -1).