Can a Linq query retrieve BLOBs from a Sql Database?

此生再无相见时 提交于 2019-12-10 14:46:39

问题


Can a Linq query retrieve BLOBs from a Sql Database?
And how do they come out?


回答1:


LINQ-To-SQL classes create properties of type System.Data.Linq.Binary for all binary and varbinary fields in SQL-Server. The Binary type has a .ToArray() method that returns a byte[], and its constructor can take a byte[].

Older versions of SQLMetal generated properties of type byte[], but the problem with these was that they failed in any joins. I think that's the main reason they replaced it with the IEquatable Binary type.




回答2:


If I'm not mistaken LINQ to SQL teats BLOB as System.Byte[]
I recall that there was some problem with SqlMetal, it generated wrong type for BLOB, but MSVS dmbl designer should work.



来源:https://stackoverflow.com/questions/53873/can-a-linq-query-retrieve-blobs-from-a-sql-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!