I am working with LINQ to SQL and my image fields are treated as Binary. It's no big issue to convert the Binary type to byte[] (you can just use the ToArray() method of the Binary object) when I need to render the images, but can someone tell me how to turn either a byte[] or Stream object into the Binary object so I can save it back to the database.
views:
3770answers:
1
+10
A:
You can use the constructor:
public Binary(byte[] value)
like this:
yourObj.BinaryProperty = new Binary(bytes);
Panos
2008-11-21 22:25:48
heh, well that's simple enough. Thank you.
Colin
2008-11-21 22:52:36