I was able to store a serialized IGeometry
object into an string field in a datatable from a File Geodatabase.
For performance issues and since the object implements IPersistStream
, I want to save the original IGeometry
object into a blob field.
So far I'm allowed to cast the geometry to IPersistStream
but haven't been able to save it to an ObjectStream
I'm using ArcObjects SDK 10.3.1. Here's the code:
// Insert Geometry to DataTable.
fieldIndex = errorsTable.FindField(m_dataBaseConstants.DataTables.Fields.Geometry);
IObjectStream objectStream = new ObjectStream();
ESRI.ArcGIS.Geometry.IGeometry geom = dataToken.Geometry;
IPersistStream persistStream = (IPersistStream)geom;
// This line throws COMException (0x80004005)
persistStream.Save(objectStream, 0);
errorRow.Value[fieldIndex] = objectStream;
I have no clue why I'm not being able to save. Can you see the problem there?
{}
) to indent your code to make it legible.