C#Microsoft Access连接池 [英] C# Microsoft Access Connection Pooling
问题描述
简介:
使用VS 2013,.Net 4
创建一个库来连接/使用Microsoft Access数据库(第三方应用程序的一部分-选择数据库不是一种选择),供以下人员使用我们的母产品。
建立池的原因:连接是由遍布整个工业设施的多台平板电脑建立的。有关性能的问题。
我需要在连接字符串中添加什么,如何对其进行初始化?
我什么时候以及如何杀死它?
以前有人处理过吗?
为什么:
到目前为止,我发现的答案是vaugue
对于 System.Data。 OleDb
连接您显然不需要执行任何操作即可启用连接池。根据MSDN文章
如先前类似问题的答案和评论所述(例如这一点),目前尚不清楚连接池是否将为使用Access数据库的应用程序带来显着的好处,但是受支持(请参阅此处,项目#3),它确实可以正常工作基于perfmon.exe为 ODBC连接池计数器显示的内容。
Intro: Using VS 2013, .Net 4 creating a library to connect/use a Microsoft Access database (part of 3rd party application - choice of database is not an option) to be used by our parent product.
Reason to pool: connections being made by multiple tablet PCs located throughout an industrial facility. Concerns regarding performance.
What do I need to add to the connection string, how do I initialize it? When and how do I kill it?
Has anyone dealt with this before?
Why: Answers I have found so far are vaugue
For a System.Data.OleDb
connection you apparently don't need to do anything to enable connection pooling. According to the MSDN article 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.
For an application using System.Data.Odbc
you need to enable connection pooling for the Access ODBC driver by double-clicking the "Microsoft Access Driver ..." name on the "Connection Pooling" tab of the ODBC Administrator control panel (odbcad32.exe) and choosing "Pool Connections to this driver"
As stated in answers and comments to similar earlier questions (like 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, item #3) and it does seem to work based on what perfmon.exe displays for the "ODBC Connection Pooling" counters.
这篇关于C#Microsoft Access连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!