Forum Discussion

mugheessiddiqui's avatar
mugheessiddiqui
Contributor
8 years ago

Read Blob object from DB and convert to System.Collection.Generic.List type of object.

I have scenario where database field stores a System.Collection.Generic.List of Double object. Now I want to read a BLOB object from database field and convert it to list of Array or any type collect...
  • tristaanogre's avatar
    8 years ago

    Rather than "Value", you might want to use the GetChunk method.  What you'll need to do is get the ActualSize of the field and then use GetChunk to retrieve it.  I've not tested this but it might look something like this:

     rs.MoveFirst();
    var blobSize = rs.Fields("slices").ActualSize;
      var blob = rs.Fields("slices").GetChunk(blobSize);