Blog

Save Blob Data using ArcObject

Posted by Yogesh Sharma Blogs | ArcObject Dec 03, 2012
Save Blob Data using ArcObject.
Store BLOB Data using arcobject.


ESRI.ArcGIS.esriSystem.IMemoryBlobStream memoryBlobStream = new ESRI.ArcGIS.esriSystem.MemoryBlobStreamClass();
memoryBlobStream.LoadFromFile(string_Filename);

//Add a new row to the table where a field having datatype blob
ESRI.ArcGIS.Geodatabase.IRow row = table.CreateRow();

//Find Blob field Index suppose field index ia 2.

//Get the Blob Field from the Table.
ESRI.ArcGIS.Geodatabase.IFields fields = row.Fields;
ESRI.ArcGIS.Geodatabase.IField field = fields.get_Field(2);

//we also check the type of field 
if (field.Type == ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeBlob)
{
    //Write the Blob (binary) stream to the Blob Field and save
    row.set_Value(2, (System.Object)memoryBlobStream);
            
    row.Store();
    return true;
}
else
{
    //unsuccessful
    return false;
}
post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter