This document is archived and information here might be outdated. Recommended version. |
Connects to an initialized Data Server.
[Visual Basic .NET]
Public Sub Connect ( _
)
[C#]
public void Connect (
);
[C++]
HRESULT Connect(
void
);
This function connects to a Database Server.
-2147212030 - FDO_E_CANNOT_CONNECT_TO_SERVER
Connect will return this error if it fails to connect to the Database Server for some reason. Use the IServiceControl.ServerStatus property to determine if the server is running and accepting connections.
The DataServerManager must be initialized by using put_ServerName or InitFromFile. You must already be a user on the server, with the appropriate permissions, in order to connect to it.
// The following code example demonstrates how to extablish a connection to a database server
public void esriDataSourcesGDB__IDataServerManager()
{
// Create a Data Server Manager object
IDataServerManager dataserverManager = new DataServerManagerClass();
dataserverManager.ServerName = "minnie\\sqlexpress";
dataserverManager.Connect();
}