I am using ArcGIS Pro 3.5.3 and hitting ArcGIS Enterprise 11.5 portal. I can find the item in the portal but I can't figure out how to query it. I have tried:
using (Geodatabase gdb = new Geodatabase(new ServiceConnectionProperties(new Uri($"{_portalLayer.Url}/0"))))
{
string whereClause = $"OBJECTID = {SelectedIntersection.ObjectId}";
QueryDef qf = new QueryDef
{
Tables = _intersectionPtFC,
WhereClause = whereClause
};
using (RowCursor rowCursor = gdb.Evaluate(qf))
{
while (rowCursor.MoveNext())
{
using (Row row = rowCursor.Current)
{
Feature thePoint = null;
thePoint = row as Feature;
System.Diagnostics.Debug.Print(row["INTERESCTION_NAME"].ToString());
locationPoint = thePoint.GetShape() as MapPoint;
}
}
}
}
Just a quick glance, maybe get the table itself and run the query against that. I'm not too familiar with the Execute statement on the gdb.
this is from the docs at https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic14110.html
using (RowCursor rowCursor = geodatabase.Evaluate(adaCompilantParksQueryDef, false))
you are missing the recycle parameter