Arun Singh
Explain how to enable and disable connection pooling in .NET?
By Arun Singh in ADO.NET on Jul 04 2012
  • Glenna Martinez
    May, 2024 21

    Hello,
    In .NET, connection pooling is typically enabled by default for database connections. Connection pooling allows reusing existing database connections instead of creating new ones for each request, which can improve performance and reduce the overhead of establishing a new connection every time.

    To enable or disable connection pooling in .NET, you generally don’t need to explicitly enable or disable it. However, you can influence its behavior by adjusting certain connection string parameters. Here’s how you can enable Connection Pooling:

    1. By default, connection pooling is enabled. You can ensure it remains enabled by following these best practices:
    2. Use the same connection string for each connection request to a specific database. This helps connections get pooled together. geometry dash lite
    3. Open and close connections explicitly in your code using the Open() and Close() methods (or the using statement) to allow connections to be returned to the pool after use.

    • 0
  • Divendra Ojha
    Jul, 2014 17

    In the connection string use Pooling=true to enable the booling(Bydefault enabled) and pooling=false to disable.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS