ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMSqlQueryDataConnection Class / GeometryType Property
Example

In This Topic
    GeometryType Property (CIMSqlQueryDataConnection)
    In This Topic
    Gets or sets the geometry type.
    Syntax
    Public Property GeometryType As esriGeometryType
    public esriGeometryType GeometryType {get; set;}
    Example
    Create a query layer
    {
        Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri(@"C:\Connections\mySDE.sde")));
        CIMSqlQueryDataConnection sqldc = new CIMSqlQueryDataConnection()
        {
            WorkspaceConnectionString = geodatabase.GetConnectionString(),
            GeometryType = esriGeometryType.esriGeometryPolygon,
            OIDFields = "OBJECTID",
            Srid = "102008",
            SqlQuery = "select * from MySDE.dbo.STATES",
            Dataset = "States"
        };
        var lcp = new LayerCreationParams(sqldc)
        {
            Name = "States"
        };
        //Note: Needs QueuedTask to run
        FeatureLayer flyr = LayerFactory.Instance.CreateLayer<FeatureLayer>(lcp, map);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also