Locks this object. Throws an exception if this object is already locked. Throws an exception if this object has not been saved. It is possible that between calling IsLocked and Lock another user may have locked the object. Therefore, it is recommended calling Lock and then trapping the MethodAccessException to determine whether the lock actually succeeded.

Namespace: DatabaseObjects
Assembly: DatabaseObjects (in DatabaseObjects.dll) Version: 3.8.1.0

Syntax

C#
public void Lock()
Visual Basic
Public Sub Lock
Visual C++
public:
virtual void Lock() sealed

Implements

IDatabaseObjectLockable..::..Lock()()()()

Exceptions

ExceptionCondition
DatabaseObjects.Exceptions..::..DatabaseObjectsExceptionThrown if the object has not been saved or the object is already locked.

See Also