Linq 查询可以从 Sql 数据库检索 BLOB 吗?

发布于 2024-07-05 03:40:41 字数 50 浏览 3 评论 0原文

Linq 查询可以从 Sql 数据库检索 BLOB 吗?
他们是怎么出来的?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

So要识趣 2024-07-12 03:40:41

如果我没有记错的话,LINQ to SQL 将 BLOB 视为 System.Byte[]
我记得 SqlMetal 有一些问题,它为 BLOB 生成了错误的类型,但 MSVS dmbl 设计器应该可以工作。

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.

太阳公公是暖光 2024-07-12 03:40:41

LINQ-To-SQL 类为 SQL-Server 中的所有二进制和 varbinary 字段创建 System.Data.Linq.Binary 类型的属性。 Binary 类型有一个返回 byte[] 的 .ToArray() 方法,并且其构造函数可以采用 byte[]。

旧版本的 SQLMetal 生成 byte[] 类型的属性,但这些属性的问题是它们在任何连接中都会失败。 我认为这是他们用 IEquatable Binary 类型替换它的主要原因。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文