My attempt to set and save the geometry on a point layer is throwing the COMException: Error HRESULT E_FAIL error on line 24, feat.Store(). @CharlesMacleod @Wolf @UmaHarano @GKmieliauskas any ideas?
Full error message is below:
ArcGIS.Core.Data.Exceptions.GeodatabaseException: 'A geodatabase exception has occurred.'
COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
var qf1 = new QueryFilter()
{
SubFields = $"{acctFieldname},{siteFieldname},{grpFieldname},{shapeFieldname}",
};
using (var gdb = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(gdbPath))))
using (var iphFc = gdb.OpenDataset<FeatureClass>(IfpHTableName))
using (var cursor1 = iphFc.Search(qf1, false))
{
while (cursor1.MoveNext())
{
using (var feat = cursor1.Current as Feature)
{
var shape = feat.GetShape();
var acctValue = Convert.ToString(feat[acctFieldname]);
var siteValue = Convert.ToString(feat[siteFieldname]);
var grpValue = Convert.ToString(feat[grpFieldname]);
var asgValue = $"{acctValue}_{siteValue}_{grpValue}";
if (geocodedAsgsWshape.ContainsKey(asgValue))
{
var newShape = geocodedAsgsWshape[asgValue];
if (!newShape.Equals(shape))
{
feat.SetShape(geocodedAsgsWshape[asgValue]);
feat.Store();
}
}
}
}
}