I am trying to save a new feature into a SQL Server gdb table. The process succeeds (editOperation.ExecuteAsync returns true) and I even get the new feature's globalID. But I cannot see the new feature in the table using SQL Server Management Studio (querying by globalID).
(I call Project.Current.SaveEditsAsync() after the code below.)
I have been following this https://github.com/Esri/arcgis-pro-sdk/blob/e79fbb738b32dd178c089a6b321e2098f8c9c069/Examples/Geodat...
This is my code
using var gdb = new Geodatabase(SMARTConnectionsProvider.Connection);
using FeatureClass fc = gdb.OpenDataset<FeatureClass>(SMARTConnectionsProvider.SOMETABLE.TableName);
var editOperation = new EditOperation();
editOperation.Callback(context =>
{
using var rowBuffer = fc.CreateRowBuffer();
rowBuffer[SMARTConnectionsProvider.SOMETABLE.Fields.RANGEID] = rangeId;
rowBuffer[SMARTConnectionsProvider.SOMETABLE.Fields.SID] = smalId;
rowBuffer[SMARTConnectionsProvider.SOMETABLE.Fields.SHAPE] = geometry;
var newFeature = fc.CreateRow(rowBuffer);
Log.Information($"GLOBALID {newFeature.GetGlobalID()}");
}, fc);
return await editOperation.ExecuteAsync();
Solved! Go to Solution.
Here are a few things to consider:
- Did Project.Current.SaveEditsAsync() return true?
- Do you see the newly added data in the table view in ArcGIS Pro ?
- Is your GeoDatabase versioned? If so that might explain why you don't see the data using SQL Server.
Here are a few things to consider:
- Did Project.Current.SaveEditsAsync() return true?
- Do you see the newly added data in the table view in ArcGIS Pro ?
- Is your GeoDatabase versioned? If so that might explain why you don't see the data using SQL Server.
- Did Project.Current.SaveEditsAsync() return true?
Yes
- Do you see the newly added data in the table view in ArcGIS Pro ?
Just opened it now, yes, my data is the table when viewed via ArcGIS Pro. The data is not there when I query the same instance/table with the same connection detail via SSMS
- Is your GeoDatabase versioned?
I don't think so, or at least Pro is showing only the default version.
Found out the feature class is indeed versioned and my data are in SOMETABLE_evw view.
in Pro - right click on the feature class - Properties - and there is says Versioning: Versioned