ArcObjects Library Reference (DataSourcesGDB)  

IDataServerManager.CreateConnectionFile Method

Create a Data Server connection file.

[Visual Basic .NET]
Public Function CreateConnectionFile ( _
    ByVal pathName As String, _
    ByVal ServerName As String _
) As String
[C#]
public string CreateConnectionFile (
    string pathName,
    string ServerName
);
[C++]
HRESULT CreateConnectionFile(
  BSTR pathName,
  BSTR ServerName,
  BSTR* connFileName
);
[C++]

Parameters

pathName [in]   pathName is a parameter of type BSTR ServerName [in]   ServerName is a parameter of type BSTR connFileName [out, retval]   connFileName is a parameter of type BSTR

Product Availability

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

Remarks

Creates a Database Server connection file (.gds).

[C#]

Please note that the pathname parameter must contain the trailing the backslashs.

// The following code example demonstrates how to create a gds connection file to the database server
public void esriDataSourcesGDB__IDataServerManager_DisplayProperties()
{
    // Create a Data Server Manager object
    IDataServerManager dataserverManager = new DataServerManagerClass();
    dataserverManager.ServerName = "minnie\\sqlexpress";
    dataserverManager.Connect();

    // Create a gds connection file
    dataserverManager.CreateConnectionFile("c:\\temp\\", dataserverManager.ServerName);
}

See Also

IDataServerManager Interface