Partager via


AppInstance.TryGetAppDatabaseConnectionDirect - Méthode (ClientRuntimeContext, SqlConnectionStringBuilder, SqlConnection, Boolean)

Retrieves a connection to the app database.

Espace de noms :  Microsoft.SharePoint.Client
Assembly :  Microsoft.SharePoint.Client (dans Microsoft.SharePoint.Client.dll)

Syntaxe

'Déclaration
Public Shared Function TryGetAppDatabaseConnectionDirect ( _
    context As ClientRuntimeContext, _
    template As SqlConnectionStringBuilder, _
    <OutAttribute> ByRef connection As SqlConnection, _
    <OutAttribute> ByRef isReadOnly As Boolean _
) As Boolean
'Utilisation
Dim context As ClientRuntimeContext
Dim template As SqlConnectionStringBuilder
Dim connection As SqlConnection
Dim isReadOnly As Boolean
Dim returnValue As Boolean

returnValue = AppInstance.TryGetAppDatabaseConnectionDirect(context, _
    template, connection, isReadOnly)
public static bool TryGetAppDatabaseConnectionDirect(
    ClientRuntimeContext context,
    SqlConnectionStringBuilder template,
    out SqlConnection connection,
    out bool isReadOnly
)

Paramètres

  • isReadOnly
    Type : System.Boolean

    Indicates whether the connection can be used to write data. true if the connection can be used to write data, otherwise false.

Valeur renvoyée

Type : System.Boolean
true if a connection can be opened, otherwise false.

Remarques

This method only returns connections to the database that are auto deployed. This method may call ExecuteQuery function on the given context.

Voir aussi

Référence

AppInstance classe

AppInstance - Membres

TryGetAppDatabaseConnectionDirect - Surcharge

Microsoft.SharePoint.Client - Espace de noms