如何解决SqlConnection错误"不支持关键字:'decr pool size'." [英] How to resolve SqlConnection error "Keyword not supported: 'decr pool size'."

查看:42
本文介绍了如何解决SqlConnection错误"不支持关键字:'decr pool size'."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建 Windows 应用程序并使用 System.Data.SqlClient.SqlConnection 对象

I am creating Windows Application and using System.Data.SqlClient.SqlConnection object

 SqlConnection targetDatabaseConnection = new SqlConnection(ConnectionString);

以下是连接字符串

Data Source=.;Initial Catalog=TestBCP_12;User ID=sa;Password=sa;Min Pool Size=100; Max Pool Size=100; Decr Pool Size=100; Incr Pool Size=100;

以下两个设置出错

 Decr Pool Size=100; Incr Pool Size=100;

我知道所有的尺寸都是 100 ,如果是的话,这是异常的原因吗?,该消息不尊重错误.

I know all the sizes are 100 , is it the cause of exception if yes? , the message is not reverent to the error .

我阅读了以下文章并基于它实现http://www.codeproject.com/文章/17768/ADO-NET-Connection-Pooling-a-Glance

I read the following article and implemented based on it http://www.codeproject.com/Articles/17768/ADO-NET-Connection-Pooling-at-a-Glance

直接在SQL中发现这是不可能的,所以问了一个新问题如何实现功能即控制增加池大小"或Decr 池大小"在建立与 SQL 的连接时?类似于ORACLE寻找其他可能的方法来实现它.

Found the answer that this is not possible in SQL directly so asked new question How to achieve functionlity i.e. controlling "Incr Pool Size" or "Decr Pool Size" while establishing connection to SQL? similar to ORACLE to find other possible ways to achieve it.

推荐答案

由于您使用的是 SqlConnection,它不支持 Decr Pool SizeIncr Pool Size.OracleConnection 支持此属性

Since you are using SqlConnection, it does not support Decr Pool Size or Incr Pool Size. This property is supported with OracleConnection

您可以查看这篇文章:DotNet 中的连接池

来自文章:

如果您使用的是 .NET 数据,则应参考文档SQL Server 以外的提供程序.其他数据提供者可能有更多汇集选项.一个很好的例子是 Oracle Data Provider,它提供两个选项——Decr Pool Size 和 Incr Pool Size——用于控制连接池的收缩或增长方式.

You should refer to the documentation if you're using a .NET Data Provider other than SQL Server. Other data providers may have more pooling options. A good example is the Oracle Data Provider, which offers two options -- Decr Pool Size and Incr Pool Size -- for controlling how a connection pool may shrink or grow.

这篇关于如何解决SqlConnection错误"不支持关键字:'decr pool size'."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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