다음을 통해 공유


SPFarm.Open method (String)

Returns an object that represents a remote server farm based on the specified connection string.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Shared Function Open ( _
    connectionString As String _
) As SPFarm
'Usage
Dim connectionString As String
Dim returnValue As SPFarm

returnValue = SPFarm.Open(connectionString)
public static SPFarm Open(
    string connectionString
)

Parameters

  • connectionString
    Type: System.String

    Contains the connection string for the configuration database of the remote server farm.

Return value

Type: Microsoft.SharePoint.Administration.SPFarm
An SPFarm object that represents the remote server farm.

Exceptions

Exception Condition
ArgumentNullException

SqlConnectionStringBuilder object is a null reference (Nothing in Visual Basic).

Remarks

This method requires access to the remote farms configuration database. If the current user or process identity does not have permission to access the database, or if the local machine is not on the same network as the database, this call will fail with an exception of type SqlException and a message indicating that this is the case.

See also

Reference

SPFarm class

SPFarm members

Open overload

Microsoft.SharePoint.Administration namespace