This document is archived and information here might be outdated.  Recommended version.


IDataServerManager.InitFromFile Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (DataSourcesGDB)  

IDataServerManager.InitFromFile Method

Initializes a saved connection to the GIS Data Server.

[Visual Basic .NET]
Public Sub InitFromFile ( _
    ByVal gdsFileName As String _
)
[C#]
public void InitFromFile (
    string gdsFileName
);
[C++]
HRESULT InitFromFile(
  BSTR gdsFileName
);
[C++]

Parameters gdsFileName [in] gdsFileName is a parameter of type BSTR

Product Availability

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

Description

This method initializes a Data Server from a Database Server connection file (.gds).

Remarks

The .gds file is created using the Add Database Server option in ArcCatalog, or the CreateConnectionFile method.

[C#]

// The following code example demonstrates how to extablish a connection to a database server.
public void esriDataSourcesGDB__IDataServerManager_InitFromFile()
{
    // Create a Data Server Manager object
    IDataServerManager dataserverManager=new DataServerManagerClass();
    dataserverManager.InitFromFile("C:\\Documents and Settings\\craig\\Application Data\\ESRI\\ArcCatalog\\TIVO_SQLEXPRESS.GDS");

    dataserverManager.Connect();
}

See Also

IDataServerManager Interface