Return Value

This method returns the number of active connections to a database. By iterating through all the databases on the instance of SQL Server, you can determine the total number of connections to databases on the instance of SQL Server.

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server()
'Display the number active connections to the database.
Console.WriteLine(srv.GetActiveDBConnectionCount("AdventureWorks2012"))