SQLConnection pool size and number of active connections in C #

In C #, you can enable / disable pooling using "Pool = True" and "Max Pool Size = XY" in the connection string.

Like: What is the maximum allowed value of "Max Pool Size" in sql connection string

Can I ask how many connections to the SQL server are active and what is the current pool size programmatically?

+6
source share
1 answer

You can use NumberOfActiveConnections or NumberOfPooledConnections ADO.NET performance counter:

https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/performance-counters

+8
source

Source: https://habr.com/ru/post/973671/


All Articles