ArcObjects Library Reference  (DataSourcesGDB)    

IDataServerManager Interface

Initializes DataServerManager object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

When To Use

Use this interface to initialize and connect to a Database Server.  Once connected, depending on your permissions level, you can perform administration tasks, get properties of the server and create and open geodatabases on the server.

Members

Description
Read-only property AvailableMemory Returns the total available memory (MB).
Method Connect Connects to an initialized Data Server.
Method CreateConnectionFile Create a Data Server connection file
Read-only property DataServerClass Returns the server class.
Read-only property DataServerType Returns the type of data server.
Method Disconnect Disconnects from the Data Server.
Method InitFromFile Initializes a saved connection to the GIS Data Server.
Read-only property IsConnected Gets whether the server is connected or not
Read-only property ProductName Returns the product name.
Read-only property ProductVersion Returns the product version.
Read/write property ServerName Sets the data server name.

CoClasses that implement IDataServerManager

CoClasses and Classes Description
DataServerManager Object to administer a Data Server.
[C#]

The IDataServerManager interface allows you perform general operations on a Database Server, such as Connect or Disconnect, etc.  To connect to a Database Server, you must first initialize the DataServerManager by setting the ServerName property or the InitFromFile method:

dataserverManager.ServerName = “minnie\\sqlexpress";
dataserverManager.InitFromFile ("C:\\Documents and Settings\\bobm\\Application Data\\ESRI\\ArcCatalog\\minnie_SQLEXPRESS.GDS");

Operations performed on the server service itself, such as stopping and starting the server, must be performed will disconnected from the server.

// The following code example demonstrates how to extablish a connection to a database server in order
// to open an existing workspace\geodatabase
public void esriDataSourcesGDB__IDataServerManager()
{
    // Create a Data Server Manager object
    IDataServerManager dataserverManager = new DataServerManagerClass();
    dataserverManager.ServerName = "minnie\\sqlexpress";

    dataserverManager.Connect();

    // Create a new workspace name object for the geodatabase we want to open
    IDataServerManagerAdmin dataservermanagerAdmin = (IDataServerManagerAdmin)dataserverManager;
    IWorkspaceName workspaceName = dataservermanagerAdmin.CreateWorkspaceName ("Landbase", "VERSION", "dbo.Default");

    // Open the workspace
    IName name = (IName)workspaceName;
    IWorkspace workspace = (IWorkspace)name.Open();
}

[Visual Basic 6.0]

The IDataServerManager interface allows you perform general operations on a Database Server, such as Connect or Disconnect, etc.  To connect to a Database Server, you must first initialize the DataServerManager by setting the ServerName property or the InitFromFile method:

pDSManager.ServerName = “minnie\sqlexpress"
pDSManager.InitFromFile ("C:\Documents and Settings\bobm\Application Data\ESRI\ArcCatalog\minnie_SQLEXPRESS.GDS")

Operations performed on the server service itself, such as stopping and starting the server, must be performed will disconnected from the server.

'Create a Data Server Manager object
Dim pDSManager As IDataServerManager
Set pDSManager = New esriDataSourcesGDB.DataServerManager

'Initialize the data server
pDSManager.ServerName = “myserver\sqlexpress”

‘Connect to the Data Server
pDSManager.Connect

Dim pDSManagerAdmin As IDataServerManagerAdmin
Set pDSManagerAdmin = pDSManager

‘Create a WorkspaceName to a Geodatabse
Dim pWorkspaceName As IWorkspaceName

Set pWorkspaceName = pDSManagerAdmin.CreateWorkspaceName ("Landbase", "VERSION", “dbo.Default”)

Dim pWorkspace As IWorkspace
Dim pName as IName
Set pName = pWorkspaceName

Set pWorkspace = pName.Open

 


Feedback Send feedback on this page