C#Microsoft Access连接池 [英] C# Microsoft Access Connection Pooling

查看:206
本文介绍了C#Microsoft Access连接池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简介:
使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆