ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMStandardDataConnection Class
Members Example

In This Topic
    CIMStandardDataConnection Class
    In This Topic
    Represents a standard data connection, the most common data connection type.
    Object Model
    CIMStandardDataConnection ClassCIMStandardDataConnection ClassCIMStandardDataConnection Class
    Syntax
    Example
    Add a WFS Service
    CIMStandardDataConnection cIMStandardDataConnection = new CIMStandardDataConnection()
    {
      WorkspaceConnectionString = @"SWAPXY=TRUE;SWAPXYFILTER=FALSE;URL=http://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WFSServer;VERSION=2.0.0",
      WorkspaceFactory = WorkspaceFactory.WFS,
      Dataset = "Continent",
      DatasetType = esriDatasetType.esriDTFeatureClass
    };
    
    // Add a new layer to the map
    var layerPamsDC = new LayerCreationParams(cIMStandardDataConnection);
    await QueuedTask.Run(() =>
    {
      Layer layer = LayerFactory.Instance.CreateLayer<FeatureLayer>(layerPamsDC, MapView.Active.Map);
    });
    Reset the URL of a feature service layer
    CIMStandardDataConnection dataConnection = dataConnectionLayer.GetDataConnection() as CIMStandardDataConnection;
    dataConnection.WorkspaceConnectionString = newConnectionString;
    dataConnectionLayer.SetDataConnection(dataConnection);
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.CIMDataConnection
             ArcGIS.Core.CIM.CIMStandardDataConnection

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also