Initializes DataServerManager object.
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.
| Description | ||
|---|---|---|
![]() |
AvailableMemory | Returns the total available memory (MB). |
![]() |
Connect | Connects to an initialized Data Server. |
![]() |
CreateConnectionFile | Create a Data Server connection file |
![]() |
DataServerClass | Returns the server class. |
![]() |
DataServerType | Returns the type of data server. |
![]() |
Disconnect | Disconnects from the Data Server. |
![]() |
InitFromFile | Initializes a saved connection to the GIS Data Server. |
![]() |
IsConnected | Gets whether the server is connected or not |
![]() |
ProductName | Returns the product name. |
![]() |
ProductVersion | Returns the product version. |
![]() |
ServerName | Sets the data server name. |
| CoClasses and Classes | Description |
|---|---|
| DataServerManager | Object to administer a Data Server. |
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();
}
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