ODBC具有SetRowsetSize,ADO.net中的等效项是什么?

编程入门 行业动态 更新时间:2024-10-26 04:27:38
本文介绍了ODBC具有SetRowsetSize,ADO中的等效项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在寻找处理高延迟连接的方法。 ODBC具有 SetRowsetSize 可以解决此问题,如此处和此处。

在ADO中是否具有与该设置等效的功能? 本文似乎暗示

通常来说,如何提高ADO中的高延迟连接性能?

解决方案

如果您担心将ADO.NET与SQL Server一起使用时的延迟,则应研究连接池。尽管请注意池碎片。

连接到数据源可能很耗时。为了最小化打开连接的成本,ADO.NET使用了一种称为连接池的优化技术,它使重复的打开和关闭连接的成本最小化。对于.NET Framework数据提供程序,连接池的处理方式有所不同。

此外,如果您需要快速检索许多记录,请使用 SqlDataReader 。与使用其他类型的ADO.NET对象(如数据集)相比,它所需的内存要少得多,并且已对其进行了优化以有效地获取大量数据。

有某些性能计数器,您可以查看它的数量活动连接池( NumberOfActiveConnectionPools )以及其他有用信息。

逐步测试指南。

I am looking for ways to deal with a high latency connection. ODBC has a SetRowsetSize that solves this problem, as described here and here.

Is there an equivalent of this setting in ADO? This article seems to suggest there is an analog in the original ADO, but it is very old and points to articles that no longer exist.

Generally speaking, how does one improve performance in ADO for high-latency connections?

解决方案

If you are concerned about latency while using ADO.NET with SQL Server, you should to look into connection pooling. Though be mindful of pool fragmentation.

Connecting to a data source can be time consuming. To minimize the cost of opening connections, ADO.NET uses an optimization technique called connection pooling, which minimizes the cost of repeatedly opening and closing connections. Connection pooling is handled differently for the .NET Framework data providers.

Additionally, if you need to retrieve many records rapidly, look into using the SqlDataReader. It requires significantly less memory than a using other types of ADO.NET objects like DataSets and its optimized for efficiently fetching large amounts of data.

There are certain performance counters you can look at to see the number of active connection pools (NumberOfActiveConnectionPools) along with other useful information.

Step by step guide on how to test.

更多推荐

ODBC具有SetRowsetSize,ADO.net中的等效项是什么?

本文发布于:2023-11-13 23:42:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585631.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SetRowsetSize   ODBC   net   ADO

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!