AppInstance.TryGetAppDatabaseConnectionDirect 方法 (ClientRuntimeContext, SqlConnection, Boolean)
Retrieves a connection to the app database.
命名空间: Microsoft.SharePoint.Client
程序集: Microsoft.SharePoint.Client(位于 Microsoft.SharePoint.Client.dll 中)
语法
声明
Public Shared Function TryGetAppDatabaseConnectionDirect ( _
context As ClientRuntimeContext, _
<OutAttribute> ByRef connection As SqlConnection, _
<OutAttribute> ByRef isReadOnly As Boolean _
) As Boolean
用法
Dim context As ClientRuntimeContext
Dim connection As SqlConnection
Dim isReadOnly As Boolean
Dim returnValue As Boolean
returnValue = AppInstance.TryGetAppDatabaseConnectionDirect(context, _
connection, isReadOnly)
public static bool TryGetAppDatabaseConnectionDirect(
ClientRuntimeContext context,
out SqlConnection connection,
out bool isReadOnly
)
参数
context
类型:Microsoft.SharePoint.Client.ClientRuntimeContextClient context to operate with.
connection
类型:System.Data.SqlClient.SqlConnectionConnection object if one could be opened, otherwise 空引用(无 在 Visual Basic 中).
isReadOnly
类型:System.BooleanIndicates whether the connection can be used to write data. true if the connection can be used to write data, otherwise false.
返回值
类型:System.Boolean
true if a connection can be opened, otherwise false.
备注
This method only returns connections to the database that are auto deployed. This method may call ExecuteQuery function on the given context.