convert decimal array to byte array

Posted on 2009-02-18
Last Modified: 2012-05-06
i want to convert decimal array to byte array.
for example: i want to reverse this code.

Dim buffer As Byte() = {5, 6, 7, 9, 122, 45}
Dim float As Decimal = BitConverter.ToInt64(buffer, 0)
Question by:sayeth
    LVL 1

    Accepted Solution

    Depends how its stored, but BitConverter.ToDouble may be your friend. That's assuming it's in IEE754 format. Where are you getting the data from in the first place?
    LVL 1

    Author Comment

    i load the data from database into a byte array. convert it to decimal(BitConverter.ToInt64(byte(), 0))
    use it in my program. i m trying save back to the database. i need to convert the decimal back to byte()
    to save it

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now