开发者

cannot convert from 'System.Data.Linq.Binary' to 'System.IO.BinaryReader'

开发者 https://www.devze.com 2023-01-12 23:42 出处:网络
开发者_C百科my table column is: AttachContentvarbinary(max) when i try to retrieve the data and i get this below error, i am using linq

开发者_C百科my table column is:

AttachContent   varbinary   (max)

when i try to retrieve the data and i get this below error, i am using linq

cannot convert from 'System.Data.Linq.Binary' to 'System.IO.BinaryReader'


System.Data.Linq.Binary contains a byte array. You can use it directly like this:

Binary binary = //your linq object
byte[] array = binary.ToArray();

If you must have a BinaryReader on the byte array you can wrap it up like this:

BinaryReader reader = new BinaryReader(new MemoryStream(binary.ToArray()));
0

精彩评论

暂无评论...
验证码 换一张
取 消