Double in blob to string?

Discussion in 'Questions (Windows Mobile)' started by HARRY, Dec 17, 2008.

  1. HARRY

    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
     
  2. agraham

    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.
     
  3. HARRY

    HARRY Active Member Licensed User

    Thanks, Agraham.

    I will try it, but it will take some time.

    Harry
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice