Share via


DataConnection.GetLockedProviderObject Method (Int32)

Retrieves the underlying data provider object, if any, which supports the current data connection.

Namespace:  Microsoft.VisualStudio.Data
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

'Declaration
Public MustOverride Function GetLockedProviderObject ( _
    lockTimeout As Integer _
) As Object
public abstract Object GetLockedProviderObject(
    int lockTimeout
)
public:
virtual Object^ GetLockedProviderObject(
    int lockTimeout
) abstract
abstract GetLockedProviderObject : 
        lockTimeout:int -> Object
public abstract function GetLockedProviderObject(
    lockTimeout : int
) : Object

Parameters

  • lockTimeout
    Type: System.Int32

    The amount of time, in seconds, to wait on locking the connection before returning.

Return Value

Type: System.Object
Returns a GetLockedProviderObject object instance, if any, that supports the current data connection, or returns nulla null reference (Nothing in Visual Basic) if the lock timeout was reached and the provider object could not be locked.

Exceptions

Exception Condition
InvalidOperationException

This object is an exclusive access proxy that no longer has exclusive access.

Remarks

This method calls the overloaded GetLockedProviderObject method with an infinite timeout (System.Threading.Timeout.Infinite).

A client can use this method when they are knowledgeable about the underlying data provider and wish to make calls directly to its API, either for performance reasons or because there is functionality that DDEX does not natively support.

An example of a provider object would be an IDbConnection instance for an ADO.NET provider, or an XmlDocument for an XML file.

.NET Framework Security

See Also

Reference

DataConnection Class

GetLockedProviderObject Overload

Microsoft.VisualStudio.Data Namespace

UnlockProviderObject

ProviderObjectIsLocked

GetLockedProviderObject

GetLockedProviderObject