在 Linq to SQL 中,是一次返回多个结果集更好,还是使用多个存储过程调用数据库更好?

发布于 2024-08-17 20:11:32 字数 252 浏览 2 评论 0原文

我正在创建一个数据密集型、高容量的网站。该网站的每个方面都是由与我正在使用的 MSSQL 数据库的交互驱动的。在一页上有 10-12 个不同的结果集,我需要在我的页面中使用它们。因此,我需要了解在 Web 应用程序中使用 Linq-to-SQL 和多个结果集时的最佳实践。

我应该让它返回多个结果集,创建随后接收数据并以这种方式利用它的类,还是只调用 10-12 存储过程并将数据返回到先前生成的 LINQ To SQL 数据类?

感谢大家的帮助!我很感激!

I am creating a very data intensive, high volume web site. Every aspect of the website is driven by interactions with the MSSQL DB that I am using. On one page there are 10-12 different resultsets that I need to utilize in my page. So I need to know the best practice when it comes to using Linq-to-SQL and multiple results sets with a web application.

Should I have it return multiple result sets, create classes that will then receive the data and utilize it that way or just call 10-12 Store Procedures and return the data to the previous generated LINQ To SQL Data Classes?

Thanks for your help everyone! I appreciate it!

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

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

发布评论

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

评论(1

↘人皮目录ツ 2024-08-24 20:11:32

与往常一样,访问数据库的次数越少越好,但这完全取决于该方法是否可维护并且适合您的应用程序的体系结构。我个人还没有开发过这样的应用程序,其中数据库的访问次数非常重要,以至于我必须预先获取所有内容,但每种情况都是不同的。

Well as always the fewer trips to the database the better, but it all depends on whether or not that approach is maintainable and fits the architecture of your application. I personally have not worked on an application where the number of trips to the database was so important that I had to fetch everything up front, but each situation is different.

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