SPContentDatabase.ExistsInFarm property

Gets a value that indicates whether the content database exists in the farm.

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

Syntax

'Declaration
Public ReadOnly Property ExistsInFarm As Boolean
    Get
'Usage
Dim instance As SPContentDatabase
Dim value As Boolean

value = instance.ExistsInFarm
public bool ExistsInFarm { get; }

Property value

Type: System.Boolean
true if the database exists in the farm; false otherwise.

Remarks

A content database can exist in the farm but not be attached to the farm, in which case the site collections within it are orphans. As a practical matter, what a true value for ExistsInFarm means is that you can pass the GUID of the content database (which is also the value of the SPContentDatabase object’s Id property) to the GetObject(Guid) method and it will return reference to the content database even if the IsAttachedToFarm property is false.

See also

Reference

SPContentDatabase class

SPContentDatabase members

Microsoft.SharePoint.Administration namespace