C# Microsoft Access 连接池

C# Microsoft Access Connection Pooling

简介: 使用 VS 2013,.Net 4 创建一个库到 connect/use Microsoft Access 数据库(第 3 方应用程序的一部分 - 数据库的选择不是一个选项)以供我们的父产品使用。

合并的原因:位于整个工业设施中的多台平板电脑正在建立连接。对性能的担忧。

我需要在连接字符串中添加什么,如何初始化它? 我何时以及如何杀死它?

有没有人处理过这个问题?

为什么: 到目前为止我找到的答案是模糊的

对于 System.Data.OleDb 连接,您显然不需要执行任何操作来启用连接池。根据 MSDN 文章 OLE DB, ODBC, and Oracle Connection Pooling (ADO.NET):

Connection Pooling for OleDb

The .NET Framework Data Provider for OLE DB automatically pools connections using OLE DB session pooling.

对于使用 System.Data.Odbc 的应用程序,您需要通过双击 ODBC 管理员控制面板 "Connection Pooling" 选项卡上的 "Microsoft Access Driver ..." 名称来为 Access ODBC 驱动程序启用连接池(odbcad32.exe) 并选择 "Pool Connections to this driver"

如之前类似问题(如 this one), it's not too clear whether connection pooling will offer a significant benefit to an application that uses an Access database, but it is supported (ref: here,第 3 项)的回答和评论中所述,它似乎确实基于 perfmon.exe 为 "ODBC Connection Pooling" 计数器显示的内容.