megan wrote:
I can easily get my byte array into the SqlBinary Sql servr field.
getting it out again is more difficult.
SqlBinary myBin = myBinaryObject; // object from SQL server field.
byte[] b= myBin ;
According to the docs, the conversion operator from SqlBinary to byte[]
is defined as 'explicit', which means you must explicitly do the cast:
byte[] b = (byte[])myBin;
"If a conversion operation can cause exceptions or lose information,
.... [it should be marked] explicit. This prevents the compiler from
silently invoking the conversion operation with possibly unforeseen
consequences."
--
Larry Lard
Replies to group please