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;
}
COMMENT USING
PREMIUM SPONSORS
Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.
Employers - Post Free Jobs
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.