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
2010-07-15 14:13:23
Thanks, that was just what I needed.
Retrocoder
2010-07-15 15:10:52