How do I convert Byte array to long or string?

J

Jim H

I am getting binary data form a database binary(8). I am copying it to a
byte array byte[8]. I need to covert this to a number, ulong, so I can
write it to a string in hex format.

Any idea on how I do this? I don't see any conversion methods.

jim
 
M

Mattias Sjögren

I am getting binary data form a database binary(8). I am copying it to a
byte array byte[8]. I need to covert this to a number, ulong, so I can
write it to a string in hex format.

BitConverter.ToUInt64()



Mattias
 
J

Jim H

Thanks! I didn't know about the BitConverter class.

Mattias Sjögren said:
I am getting binary data form a database binary(8). I am copying it to a
byte array byte[8]. I need to covert this to a number, ulong, so I can
write it to a string in hex format.

BitConverter.ToUInt64()



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top