How to enable and disable connection pooling ?

 Posted by Bharathi Cherukuri on 5/22/2012 | Category: ADO.NET Interview questions | Views: 4098 | Points: 40

For .NET this connection pooling is enabled by default but if you want to just make sure set Pooling = true in the connection string.
To disable connection pooling, set Pooling = false in connection string if it is an ADO.NET Connection.
If it is an OLEDBConnection object set OLE DB Services = -4 in the connection string.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Akiii on: 5/23/2012 | Points: 10
good one !

Posted by: Bharathi Cherukuri on: 5/23/2012 | Points: 10
Thanks Akiii !

Posted by: Sheonarayan on: 1/24/2013 | Points: 10
Here is the typical example of Connection Pooling connection string in the Web.config file

<add name="ConnStr" connectionString="Server=;Database=rtcmain; UID=rfgser; Password=fdfdfdf;Connection Timeout=30; Min Pool Size=5; Max Pool Size=40;"/>


Login to post response