This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > DataSourcesGDB > ESRI.ArcGIS.DataSourcesGDB > Interfaces > ID > IDataServerManager Interface > IDataServerManager.CreateConnectionFile Method (ArcObjects .NET 10.4 SDK) |
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
Creates a Database Server connection file (.gds).
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);
}