How to resolve SqlConnection error “Keyword not supported: 'decr pool size'.”

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

 SqlConnection targetDatabaseConnection = new SqlConnection(ConnectionString);

Following is the connection string

  • Can't connect to remote sever
  • Check if stored procedure is running
  • Runing Total sum minus different condition
  • Link server error Invalid use of schema or catalog for OLE DB provider “SQLNCLI10” for linked server “LINK71”
  • using GridView to display data in fixed row positions
  • Convert unknown number of comma separated varchars within 1 column into multiple columns
  • 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;
    

    Getting error with the following two settings

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

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

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

    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.

  • How to achieve functionlity i.e. controlling “Incr Pool Size” or “Decr Pool Size” while establishing connection to SQL? similar to ORACLE
  • XML assigned to SqlXml parameter got extra-encoded?
  • Stored Procedure is taking time in execution
  • SQL Server - Getting Execution Plan XML By Proc Name
  • ConnectionString for SQL Server
  • Is there a bug in SqlDataReader.HasRows when running against SQL Server 2008?
  • 3 Solutions collect form web for “How to resolve SqlConnection error “Keyword not supported: 'decr pool size'.””

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

    You may check this article: Connection Pooling in DotNet

    From the article:

    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.

    The list of accepted keywords is documented on MSDN. Neither Decr Pool Size nor Incr Pool Size are listed there.

    You Are using a syntax for Oracle connection strings against a SqlServer database.

    DECR POOL SIZE and INCR POOL SIZE are not supported in SqlServer connections.

    Simply remove these two parts from your connection.
    Also I suggest to remove the Max Pool Size=100; since this is the default value.
    The Min Pool Size=100; could also be removed if there is no special requirement to have an initial minimum size

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.