tags:

views:

31

answers:

1

In my C# application I receive MSMQ messages. Sometimes the message body is XML which I can handle without any problems. Sometimes the message could be of any data type so I just need to put it into a database table. To do this I need to take the message body and convert it in a “byte[]” type. My question is, how to convert the message body into byte[]?

+2  A: 

The Message object has a BodyStream property which exposes the body as a Stream, which you can then convert to a byte[] using the technique in this answer.

Stuart Dunkeld
Thanks, that was just what I needed.
Retrocoder