Double in blob to string?

HARRY

Active Member
Licensed User
Hi,

A double is stored in a blob in a SQLite data base, say starting on position 16. I know the column, say 4. I didnt do that, for me it is a given fact. I need to 'read' this double from the blob and to convert it to a string, showing the value, say 1.234567. Can somebody help me?

Harry
 

agraham

Expert
Licensed User
Get the blob as a byte array, data() = DataReader.GetBytes(column), then use my BytesConverter library http://www.basic4ppc.com/forum/additional-libraries/2565-byteconverter-library.html#post14218 to convert the value you want. Watch out for possible little/bigendian problems depending upon the source of the data for the blob.

Note that, as documented in the help, the library converts one or more bytes of an array to a fundamental data type. Then Basic4ppc, which knows about all the fundamental types, converts that data on input into its own internal representation which is in fact a string.
 
Top