Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Binary Expression Vs Binary

Posted on by 125

Hi,

Any idea how to deal with this error, i'm reading from a fingerprint data Bin file and trying to save it as Binary Data Type

---------------------------
Microsoft Dynamics NAV
---------------------------
The expression Binary cannot be type-converted to a Binary value.
---------------------------
OK
---------------------------

*This post is locked for comments

  • Suggested answer
    4BzSoftware Profile Picture
    4BzSoftware 6,071 on at
    RE: Binary Expression Vs Binary

    Hi Ral,

    What is code looked like? Did you use Memory Stream dotnet object?

  • Suggested answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Binary Expression Vs Binary

    add a blob field, called e.g. content, to your data table with properties subtype=bitmap and compressed=false.

    let's say the data table is called bindata.

    use following command to import the fingerprint binary file to the field:

    bindata.content.IMPORT('c:\temp\fingerprint.bin');

    to read that data from the field, use:

    // recNo is the prim. key of table bindata

    // variable ch is of type char

    // variable file is of type FILE

    bindata.GET(recNo);

    bindata.CALCFIELDS(content);

    IF bindata.content.HASVALUE THEN BEGIN

     file.CREATE('c:\temp\fp-out.bin');

     file.TEXTMODE(FALSE);

     bindata.content.CREATEINSTREAM(inStream);

     WHILE NOT inStream.EOS DO BEGIN

       inStream.READ(ch);

       file.WRITE(ch);

     END;

     file.CLOSE;

    END;

  • keoma Profile Picture
    keoma 32,675 on at
    RE: Binary Expression Vs Binary

    hi,

    try to use type variant or blob instead for saving your data.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans