public async Task EvaluatingQueryDefWithOuterJoin()
{
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file"))))
{
QueryDef queryDefWithLeftOuterJoin = new QueryDef
{
Tables = "CommunityAddress LEFT OUTER JOIN MunicipalBoundary on CommunityAddress.Municipality = MunicipalBoundary.Name",
SubFields = "CommunityAddress.OBJECTID, CommunityAddress.Shape, CommunityAddress.SITEADDID, CommunityAddress.ADDRNUM, CommunityAddress.FULLNAME, CommunityAddress.FULLADDR, CommunityAddress.MUNICIPALITY, MunicipalBoundary.Name, MunicipalBoundary.MUNITYP, MunicipalBoundary.LOCALFIPS",
};
using (RowCursor rowCursor = geodatabase.Evaluate(queryDefWithLeftOuterJoin, false))
{
while (rowCursor.MoveNext())
{
using (Row row = rowCursor.Current)
{
Feature feature = row as Feature;
Geometry shape = feature.GetShape();
int siteAddressId = Convert.ToInt32(row["CommunityAddress.SITEADDID"]);
String stateName = Convert.ToString(row["MunicipalBoundary.name"]);
}
}
}
}
});
}